#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*/ scanf(char *, ...);
int main() {
  char letter = 'A';
  printf("%c\n", letter);
  char str[20];
  printf("Write a name:\n");
  scanf("%s", str);
  printf("Hello %s\n", str);
  int number = 15, number2 = 24;
  while (number >= 10) {
    printf("Chose a row ");
    scanf("%i", &number);
    if (number >= 10) {
      printf("You can not chose more than 10\n");
    }
  }
  while (number2 >= 10) {
    printf("Chose a col");
    scanf("%i", &number2);
    if (number2 >= 10) {
      printf("You can not chose more than 10\n");
    }
  }
  int matrix[10][10] = {0};
  matrix[number][number2] = 1;
  for (int row = 0; row < 10; row++) {
    for (int col = 0; col < 10; col++) {
      printf("%i", matrix[row][col]);
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x41,-0x5(%rbp)
movsbl -0x5(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rsi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xf,-0x24(%rbp)
movl   $0x18,-0x28(%rbp)
cmpl   $0xa,-0x24(%rbp)
jl     11df <main+0xaf>
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe76(%rip),%rdi
lea    -0x24(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
cmpl   $0xa,-0x24(%rbp)
jl     11da <main+0xaa>
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1198 <main+0x68>
jmp    11e4 <main+0xb4>
cmpl   $0xa,-0x28(%rbp)
jl     122b <main+0xfb>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe2a(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
cmpl   $0xa,-0x28(%rbp)
jl     1226 <main+0xf6>
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e4 <main+0xb4>
lea    -0x1c0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1040 <memset@plt>
movslq -0x24(%rbp),%rcx
lea    -0x1c0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
movl   $0x0,-0x1c4(%rbp)
cmpl   $0xa,-0x1c4(%rbp)
jge    12ec <main+0x1bc>
movl   $0x0,-0x1c8(%rbp)
cmpl   $0xa,-0x1c8(%rbp)
jge    12ca <main+0x19a>
movslq -0x1c4(%rbp),%rcx
lea    -0x1c0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c8(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c8(%rbp)
jmp    127c <main+0x14c>
lea    0xd7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c4(%rbp)
jmp    1265 <main+0x135>
xor    %eax,%eax
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1c0,%rsp
lea    0xe9a(%rip),%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb4(%rip),%rdi
call   1040 <puts@plt>
lea    0xe7f(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe6c(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
movl   $0xf,0x8(%rsp)
movl   $0x18,0xc(%rsp)
lea    0xe55(%rip),%r14
lea    0xe5b(%rip),%r15
lea    0x8(%rsp),%rbx
lea    0xe6c(%rip),%r12
nop
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
cmpl   $0xa,0x8(%rsp)
jl     11fd <main+0xad>
mov    %r12,%rdi
call   1040 <puts@plt>
cmpl   $0x9,0x8(%rsp)
jg     11d0 <main+0x80>
lea    0xe1d(%rip),%r14
lea    0xe13(%rip),%r15
lea    0xc(%rsp),%rbx
lea    0xe24(%rip),%r12
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0xc(%rsp),%ebp
cmp    $0xa,%ebp
jl     1251 <main+0x101>
mov    %r12,%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%ebp
cmp    $0x9,%ebp
jg     1220 <main+0xd0>
movslq 0x8(%rsp),%rbx
lea    0x30(%rsp),%rdi
mov    $0x190,%edx
xor    %esi,%esi
call   1060 <memset@plt>
movslq %ebp,%rax
lea    (%rbx,%rbx,4),%rcx
lea    (%rsp,%rcx,8),%rcx
add    $0x30,%rcx
movl   $0x1,(%rcx,%rax,4)
mov    $0x24,%ebx
lea    0xd95(%rip),%r14
nopl   0x0(%rax)
mov    0xc(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x14(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x24(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x28(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2c(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x30(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x28,%rbx
cmp    $0x1b4,%rbx
jne    1290 <main+0x140>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%c\0A\00"
@.str.1 = [15 x i8] c"Write a name:\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [10 x i8] c"Hello %s\0A\00"
@.str.4 = [13 x i8] c"Chose a row \00"
@.str.5 = [3 x i8] c"%i\00"
@.str.6 = [32 x i8] c"You can not chose more than 10\0A\00"
@.str.7 = [12 x i8] c"Chose a col\00"
@.str.8 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [20 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca [10 x [10 x i32]]
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
store i8 65, i8* %2
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %15)
store i32 15, i32* %4
store i32 24, i32* %5
br label %17
17: ; preds = %27, %0
%18 = load i32, i32* %4
%19 = icmp sge i32 %18, 10
br i1 %19, label %20, label %28
20: ; preds = %17
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %4)
%23 = load i32, i32* %4
%24 = icmp sge i32 %23, 10
br i1 %24, label %25, label %27
25: ; preds = %20
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
br label %27
27: ; preds = %25, %20
br label %17
28: ; preds = %17
br label %29
29: ; preds = %39, %28
%30 = load i32, i32* %5
%31 = icmp sge i32 %30, 10
br i1 %31, label %32, label %40
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %5)
%35 = load i32, i32* %5
%36 = icmp sge i32 %35, 10
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0))
br label %39
39: ; preds = %37, %32
br label %29
40: ; preds = %29
%41 = bitcast [10 x [10 x i32]]* %6 to i8*
%42 = load i32, i32* %4
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %6, i64 0, i64 %43
%45 = load i32, i32* %5
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [10 x i32], [10 x i32]* %44, i64 0, i64 %46
store i32 1, i32* %47
store i32 0, i32* %7
br label %48
48: ; preds = %69, %40
%49 = load i32, i32* %7
%50 = icmp slt i32 %49, 10
br i1 %50, label %51, label %72
51: ; preds = %48
store i32 0, i32* %8
br label %52
52: ; preds = %64, %51
%53 = load i32, i32* %8
%54 = icmp slt i32 %53, 10
br i1 %54, label %55, label %67
55: ; preds = %52
%56 = load i32, i32* %7
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %6, i64 0, i64 %57
%59 = load i32, i32* %8
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds [10 x i32], [10 x i32]* %58, i64 0, i64 %60
%62 = load i32, i32* %61
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %62)
br label %64
64: ; preds = %55
%65 = load i32, i32* %8
%66 = add nsw i32 %65, 1
store i32 %66, i32* %8
br label %52
67: ; preds = %52
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %69
69: ; preds = %67
%70 = load i32, i32* %7
%71 = add nsw i32 %70, 1
store i32 %71, i32* %7
br label %48
72: ; preds = %48
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [10 x i8] c"Hello %s\0A\00"
@.str.4 = [13 x i8] c"Chose a row \00"
@.str.5 = [3 x i8] c"%i\00"
@.str.7 = [12 x i8] c"Chose a col\00"
@str = [14 x i8] c"Write a name:\00"
@str.10 = [31 x i8] c"You can not chose more than 10\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x [10 x i32]]
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 65)
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%10 = bitcast i32* %2 to i8*
store i32 15, i32* %2
%11 = bitcast i32* %3 to i8*
store i32 24, i32* %3
br label %12
12: ; preds = %0, %17
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = icmp sgt i32 %15, 9
br i1 %16, label %17, label %21
17: ; preds = %12
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.10, i64 0, i64 0))
%19 = load i32, i32* %2
%20 = icmp sgt i32 %19, 9
br i1 %20, label %12, label %21
21: ; preds = %12, %17
br label %22
22: ; preds = %21, %27
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%25 = load i32, i32* %3
%26 = icmp sgt i32 %25, 9
br i1 %26, label %27, label %31
27: ; preds = %22
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.10, i64 0, i64 0))
%29 = load i32, i32* %3
%30 = icmp sgt i32 %29, 9
br i1 %30, label %22, label %31
31: ; preds = %22, %27
%32 = phi i32 [ %29, %27 ], [ %25, %22 ]
%33 = load i32, i32* %2
%34 = bitcast [10 x [10 x i32]]* %4 to i8*
%35 = sext i32 %33 to i64
%36 = sext i32 %32 to i64
%37 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %35, i64 %36
store i32 1, i32* %37
br label %38
38: ; preds = %31, %38
%39 = phi i64 [ 0, %31 ], [ %71, %38 ]
%40 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %39, i64 0
%41 = load i32, i32* %40
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %41)
%43 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %39, i64 1
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %44)
%46 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %39, i64 2
%47 = load i32, i32* %46
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %47)
%49 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %39, i64 3
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %50)
%52 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %39, i64 4
%53 = load i32, i32* %52
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %53)
%55 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %39, i64 5
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %56)
%58 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %39, i64 6
%59 = load i32, i32* %58
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %59)
%61 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %39, i64 7
%62 = load i32, i32* %61
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %62)
%64 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %39, i64 8
%65 = load i32, i32* %64
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %65)
%67 = getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* %4, i64 0, i64 %39, i64 9
%68 = load i32, i32* %67
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32 %68)
%70 = call i32 @putchar(i32 10)
%71 = add nuw nsw i64 %39, 1
%72 = icmp eq i64 %71, 10
br i1 %72, label %73, label %38
73: ; preds = %38
ret i32 0
}