#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 /*<<< orphan*/ system(char *);
int main() {
  char nome[100];
  int scelta;
  int lung;
  int i;
  int k;
  int cont;
  do {
    printf("\nCALCOLO OCCORRENZE \n");
    printf("Parti del programma da svolgere:\n");
    printf("1-Inserisci il nome \n");
    printf("2-Lunghezza del nome\n");
    printf("3-Calcolo dell'occorrenze del nome\n");
    printf("0-EXIT \n");
    do {
      printf("Scegli la parte di programma da eseguire(0-3)");
      scanf("%d", &scelta);
    } while ((scelta < 0) || (scelta > 3));
    switch (scelta) {
    case 1:
      printf("\nInserisci il tuo nome (Massimo 100 caratteri): ");
      scanf("%s", nome);
      printf("\nIl nome inserito e': %s\n", nome);
      break;
    case 2:
      lung = 0;
      while (nome[lung] != '\0') {
        lung++;
      }
      printf("\nIl tuo nome e' lungo %d caratteri \n", lung);
      break;
    case 3:
      lung = 0;
      while (nome[lung] != '\0') {
        lung++;
      }
      for (i = 0; i < lung; i++) {
        cont = 1;
        if (nome[i] != 0) {
          for (k = i + 1; k < lung; k++) {
            if (nome[i] == nome[k]) {
              cont++;
              nome[k] = 0;
            }
          }
        }
        if (nome[i] != 0) {
          printf("\nIl carattere %c si ripete %d volte\n", nome[i], cont);
        }
      }
      break;
    }
  } while (scelta != 0);
  system("PAUSE");
  system("PAUSE");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf14(%rip),%rdi
lea    -0x74(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x74(%rbp)
mov    %al,-0x85(%rbp)
jl     11d5 <main+0xa5>
cmpl   $0x3,-0x74(%rbp)
setg   %al
mov    %al,-0x85(%rbp)
mov    -0x85(%rbp),%al
test   $0x1,%al
jne    1196 <main+0x66>
mov    -0x74(%rbp),%eax
mov    %eax,-0x8c(%rbp)
sub    $0x1,%eax
je     1222 <main+0xf2>
jmp    11fa <main+0xca>
mov    -0x8c(%rbp),%eax
sub    $0x2,%eax
je     1259 <main+0x129>
jmp    120e <main+0xde>
mov    -0x8c(%rbp),%eax
sub    $0x3,%eax
je     1296 <main+0x166>
jmp    1392 <main+0x262>
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x70(%rbp),%rsi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1392 <main+0x262>
movl   $0x0,-0x78(%rbp)
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1280 <main+0x150>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1260 <main+0x130>
mov    -0x78(%rbp),%esi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1392 <main+0x262>
movl   $0x0,-0x78(%rbp)
movslq -0x78(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     12bd <main+0x18d>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    129d <main+0x16d>
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x78(%rbp),%eax
jge    138d <main+0x25d>
movl   $0x1,-0x84(%rbp)
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     134b <main+0x21b>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x78(%rbp),%eax
jge    1346 <main+0x216>
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
movslq -0x80(%rbp),%rcx
movsbl -0x70(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    1333 <main+0x203>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
movslq -0x80(%rbp),%rax
movb   $0x0,-0x70(%rbp,%rax,1)
jmp    1338 <main+0x208>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    12f5 <main+0x1c5>
jmp    134b <main+0x21b>
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     137a <main+0x24a>
movslq -0x7c(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%esi
mov    -0x84(%rbp),%edx
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    137f <main+0x24f>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    12c4 <main+0x194>
jmp    1392 <main+0x262>
jmp    1397 <main+0x267>
cmpl   $0x0,-0x74(%rbp)
jne    1142 <main+0x12>
lea    0xdb2(%rip),%rdi
call   1030 <system@plt>
lea    0xda6(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
lea    0xeab(%rip),%rbx
lea    0xed2(%rip),%r15
lea    0xc(%rsp),%r12
jmp    11b7 <main+0x77>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0xc(%rsp)
lea    0xe4f(%rip),%rbx
je     131f <main+0x1df>
lea    0xf11(%rip),%rdi
call   1030 <puts@plt>
lea    0xf1a(%rip),%rdi
call   1030 <puts@plt>
lea    0xf2f(%rip),%rdi
call   1030 <puts@plt>
lea    0xf38(%rip),%rdi
call   1030 <puts@plt>
lea    0xf41(%rip),%rdi
call   1030 <puts@plt>
lea    0xf58(%rip),%rdi
call   1030 <puts@plt>
nop
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x3,%eax
ja     1200 <main+0xc0>
cmp    $0x1,%eax
je     1170 <main+0x30>
cmp    $0x2,%eax
je     12f0 <main+0x1b0>
cmp    $0x3,%eax
jne    131f <main+0x1df>
mov    $0xffffffffffffffff,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edx,%eax
cmpb   $0x0,0x11(%rsp,%rcx,1)
lea    0x1(%rcx),%rcx
lea    0x1(%rax),%edx
jne    1250 <main+0x110>
test   %ecx,%ecx
je     11a5 <main+0x65>
mov    %ecx,%ebp
mov    %eax,%r13d
add    $0xffffffffffffffff,%r13
lea    0x11(%rsp),%rbx
xor    %r14d,%r14d
jmp    12a6 <main+0x166>
nopl   0x0(%rax,%rax,1)
test   %cl,%cl
je     1295 <main+0x155>
movsbl %cl,%esi
lea    0xe16(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
add    $0xffffffffffffffff,%r13
cmp    %rbp,%r14
je     11a5 <main+0x65>
mov    %r14,%rax
mov    0x10(%rsp,%r14,1),%cl
add    $0x1,%r14
test   %cl,%cl
je     1295 <main+0x155>
mov    $0x1,%edx
cmp    %rbp,%r14
jae    1284 <main+0x144>
mov    $0x1,%edx
xor    %esi,%esi
jmp    12de <main+0x19e>
nopl   0x0(%rax)
movzbl 0x10(%rsp,%rax,1),%ecx
add    $0x1,%rsi
cmp    %rsi,%r13
je     1280 <main+0x140>
cmp    (%rbx,%rsi,1),%cl
jne    12d0 <main+0x190>
add    $0x1,%edx
movb   $0x0,(%rbx,%rsi,1)
jmp    12d0 <main+0x190>
nopl   0x0(%rax)
mov    $0xffffffff,%esi
lea    0x10(%rsp),%rax
nopw   0x0(%rax,%rax,1)
add    $0x1,%esi
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1300 <main+0x1c0>
lea    0xd6c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11a5 <main+0x65>
lea    0xda3(%rip),%rbx
mov    %rbx,%rdi
call   1040 <system@plt>
mov    %rbx,%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"\0ACALCOLO OCCORRENZE \0A\00"
@.str.1 = [34 x i8] c"Parti del programma da svolgere:\0A\00"
@.str.2 = [22 x i8] c"1-Inserisci il nome \0A\00"
@.str.3 = [22 x i8] c"2-Lunghezza del nome\0A\00"
@.str.4 = [36 x i8] c"3-Calcolo dell'occorrenze del nome\0A\00"
@.str.5 = [9 x i8] c"0-EXIT \0A\00"
@.str.6 = [46 x i8] c"Scegli la parte di programma da eseguire(0-3)\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [49 x i8] c"\0AInserisci il tuo nome (Massimo 100 caratteri): \00"
@.str.9 = [3 x i8] c"%s\00"
@.str.10 = [26 x i8] c"\0AIl nome inserito e': %s\0A\00"
@.str.11 = [37 x i8] c"\0AIl tuo nome e' lungo %d caratteri \0A\00"
@.str.12 = [37 x i8] c"\0AIl carattere %c si ripete %d volte\0A\00"
@.str.13 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
br label %8
8: ; preds = %122, %0
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %15
15: ; preds = %24, %8
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %3)
br label %18
18: ; preds = %15
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = load i32, i32* %3
%23 = icmp sgt i32 %22, 3
br label %24
24: ; preds = %21, %18
%25 = phi i1 [ true, %18 ], [ %23, %21 ]
br i1 %25, label %15, label %26
26: ; preds = %24
%27 = load i32, i32* %3
switch i32 %27, label %121 [
i32 1, label %28
i32 2, label %34
i32 3, label %48
]
28: ; preds = %26
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0))
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%31 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %30)
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i8* %32)
br label %121
34: ; preds = %26
store i32 0, i32* %4
br label %35
35: ; preds = %42, %34
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %37
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = icmp ne i32 %40, 0
br i1 %41, label %42, label %45
42: ; preds = %35
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 1
store i32 %44, i32* %4
br label %35
45: ; preds = %35
%46 = load i32, i32* %4
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i32 %46)
br label %121
48: ; preds = %26
store i32 0, i32* %4
br label %49
49: ; preds = %56, %48
%50 = load i32, i32* %4
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %51
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %59
56: ; preds = %49
%57 = load i32, i32* %4
%58 = add nsw i32 %57, 1
store i32 %58, i32* %4
br label %49
59: ; preds = %49
store i32 0, i32* %5
br label %60
60: ; preds = %117, %59
%61 = load i32, i32* %5
%62 = load i32, i32* %4
%63 = icmp slt i32 %61, %62
br i1 %63, label %64, label %120
64: ; preds = %60
store i32 1, i32* %7
%65 = load i32, i32* %5
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %101
71: ; preds = %64
%72 = load i32, i32* %5
%73 = add nsw i32 %72, 1
store i32 %73, i32* %6
br label %74
74: ; preds = %97, %71
%75 = load i32, i32* %6
%76 = load i32, i32* %4
%77 = icmp slt i32 %75, %76
br i1 %77, label %78, label %100
78: ; preds = %74
%79 = load i32, i32* %5
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %80
%82 = load i8, i8* %81
%83 = sext i8 %82 to i32
%84 = load i32, i32* %6
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %85
%87 = load i8, i8* %86
%88 = sext i8 %87 to i32
%89 = icmp eq i32 %83, %88
br i1 %89, label %90, label %96
90: ; preds = %78
%91 = load i32, i32* %7
%92 = add nsw i32 %91, 1
store i32 %92, i32* %7
%93 = load i32, i32* %6
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %94
store i8 0, i8* %95
br label %96
96: ; preds = %90, %78
br label %97
97: ; preds = %96
%98 = load i32, i32* %6
%99 = add nsw i32 %98, 1
store i32 %99, i32* %6
br label %74
100: ; preds = %74
br label %101
101: ; preds = %100, %64
%102 = load i32, i32* %5
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %103
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = icmp ne i32 %106, 0
br i1 %107, label %108, label %116
108: ; preds = %101
%109 = load i32, i32* %5
%110 = sext i32 %109 to i64
%111 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %110
%112 = load i8, i8* %111
%113 = sext i8 %112 to i32
%114 = load i32, i32* %7
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0), i32 %113, i32 %114)
br label %116
116: ; preds = %108, %101
br label %117
117: ; preds = %116
%118 = load i32, i32* %5
%119 = add nsw i32 %118, 1
store i32 %119, i32* %5
br label %60
120: ; preds = %60
br label %121
121: ; preds = %26, %120, %45, %28
br label %122
122: ; preds = %121
%123 = load i32, i32* %3
%124 = icmp ne i32 %123, 0
br i1 %124, label %8, label %125
125: ; preds = %122
%126 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%127 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%128 = load i32, i32* %1
ret i32 %128
}

LLVM IR (-O2):
@.str.6 = [46 x i8] c"Scegli la parte di programma da eseguire(0-3)\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [49 x i8] c"\0AInserisci il tuo nome (Massimo 100 caratteri): \00"
@.str.9 = [3 x i8] c"%s\00"
@.str.10 = [26 x i8] c"\0AIl nome inserito e': %s\0A\00"
@.str.11 = [37 x i8] c"\0AIl tuo nome e' lungo %d caratteri \0A\00"
@.str.12 = [37 x i8] c"\0AIl carattere %c si ripete %d volte\0A\00"
@.str.13 = [6 x i8] c"PAUSE\00"
@str = [21 x i8] c"\0ACALCOLO OCCORRENZE \00"
@str.14 = [33 x i8] c"Parti del programma da svolgere:\00"
@str.15 = [21 x i8] c"1-Inserisci il nome \00"
@str.16 = [21 x i8] c"2-Lunghezza del nome\00"
@str.17 = [35 x i8] c"3-Calcolo dell'occorrenze del nome\00"
@str.18 = [8 x i8] c"0-EXIT \00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %75, %0
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.14, i64 0, i64 0))
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.15, i64 0, i64 0))
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.16, i64 0, i64 0))
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.17, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.18, i64 0, i64 0))
br label %12
12: ; preds = %12, %5
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = icmp ugt i32 %15, 3
br i1 %16, label %12, label %17
17: ; preds = %12
switch i32 %15, label %78 [
i32 1, label %18
i32 2, label %22
i32 3, label %31
]
18: ; preds = %17
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %3)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i8* %3)
br label %75
22: ; preds = %17, %22
%23 = phi i64 [ %27, %22 ], [ 0, %17 ]
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 0
%27 = add nuw i64 %23, 1
br i1 %26, label %28, label %22
28: ; preds = %22
%29 = trunc i64 %23 to i32
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.11, i64 0, i64 0), i32 %29)
br label %75
31: ; preds = %17, %31
%32 = phi i64 [ %36, %31 ], [ 0, %17 ]
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = icmp eq i8 %34, 0
%36 = add nuw i64 %32, 1
br i1 %35, label %37, label %31
37: ; preds = %31
%38 = trunc i64 %32 to i32
%39 = icmp eq i32 %38, 0
br i1 %39, label %75, label %40
40: ; preds = %37
%41 = and i64 %32, 4294967295
br label %42
42: ; preds = %40, %72
%43 = phi i64 [ 0, %40 ], [ %48, %72 ]
%44 = phi i64 [ 1, %40 ], [ %73, %72 ]
%45 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %43
%46 = load i8, i8* %45
%47 = icmp eq i8 %46, 0
%48 = add nuw nsw i64 %43, 1
br i1 %47, label %72, label %49
49: ; preds = %42
%50 = icmp ult i64 %48, %41
br i1 %50, label %51, label %67
51: ; preds = %49, %60
%52 = phi i8 [ %64, %60 ], [ %46, %49 ]
%53 = phi i64 [ %62, %60 ], [ %44, %49 ]
%54 = phi i32 [ %61, %60 ], [ 1, %49 ]
%55 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %53
%56 = load i8, i8* %55
%57 = icmp eq i8 %52, %56
br i1 %57, label %58, label %60
58: ; preds = %51
%59 = add nsw i32 %54, 1
store i8 0, i8* %55
br label %60
60: ; preds = %51, %58
%61 = phi i32 [ %59, %58 ], [ %54, %51 ]
%62 = add nuw nsw i64 %53, 1
%63 = icmp eq i64 %62, %41
%64 = load i8, i8* %45
br i1 %63, label %65, label %51
65: ; preds = %60
%66 = icmp eq i8 %64, 0
br i1 %66, label %72, label %67
67: ; preds = %49, %65
%68 = phi i32 [ %61, %65 ], [ 1, %49 ]
%69 = phi i8 [ %64, %65 ], [ %46, %49 ]
%70 = sext i8 %69 to i32
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.12, i64 0, i64 0), i32 %70, i32 %68)
br label %72
72: ; preds = %42, %65, %67
%73 = add nuw nsw i64 %44, 1
%74 = icmp eq i64 %48, %41
br i1 %74, label %75, label %42
75: ; preds = %72, %37, %18, %28
%76 = load i32, i32* %2
%77 = icmp eq i32 %76, 0
br i1 %77, label %78, label %5
78: ; preds = %17, %75
%79 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
%80 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0))
ret i32 0
}