#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() {
  int I;
  char nome[100];
  int scelta;
  char nome_due[100];
  int k;
  int occorrenze;
  int lunghezza;
  printf("\n                 programma per il calcolo della lunghezza e delle "
         "occorrenze");
  do {
    printf("\n");
    printf("\n 1. Inserisci il nome di massimo 100 caratteri");
    printf("\n 2. Calcolo lunghezza stringa");
    printf("\n 3. Calcolo occorrenze");
    printf("\n 0. EXIT");
    printf("\n");
    do {
      printf("\n inserisci la tua scelta(0-3):	");
      scanf("%d", &scelta);
    } while ((scelta < 0) || (scelta > 3));
    switch (scelta) {
    case 1:
      printf("\n inserisci il nome:	");
      scanf("%s", nome);
      printf("\n");
      printf("\n IL TUO NOME E' STATO INSERITO CORRETTAMENTE");
      break;
    case 2:
      I = 0;
      while (nome[I] != '\0') {
        I++;
      }
      printf("\n la lunghezza della tua stringa e' di:  %d", I);
      break;
    case 3:
      I = 0;
      while (nome[I] != 0) {
        nome_due[I] = nome[I];
        I++;
      }
      I = 0;
      while (nome_due[I] != 0) {
        k = nome_due[I];
        lunghezza = 0;
        occorrenze = 0;
        while (nome_due[lunghezza] != 0) {
          if (nome_due[lunghezza] == k) {
            occorrenze++;
            nome_due[lunghezza] = '0';
          }
          lunghezza++;
        }
        printf("Il carattere %c si ripete %d volte\n", k, occorrenze);
        I++;
      }
      break;
    default:
      break;
    }
    printf("\n\n");
  } while (scelta != 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1031(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfa7(%rip),%rdi
lea    -0x74(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x74(%rbp)
mov    %al,-0xed(%rbp)
jl     11d3 <main+0xb3>
cmpl   $0x3,-0x74(%rbp)
setg   %al
mov    %al,-0xed(%rbp)
mov    -0xed(%rbp),%al
test   $0x1,%al
jne    1194 <main+0x74>
mov    -0x74(%rbp),%eax
mov    %eax,-0xf4(%rbp)
sub    $0x1,%eax
je     1220 <main+0x100>
jmp    11f8 <main+0xd8>
mov    -0xf4(%rbp),%eax
sub    $0x2,%eax
je     1261 <main+0x141>
jmp    120c <main+0xec>
mov    -0xf4(%rbp),%eax
sub    $0x3,%eax
je     129e <main+0x17e>
jmp    13ac <main+0x28c>
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xf31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13b1 <main+0x291>
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1288 <main+0x168>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1268 <main+0x148>
mov    -0x8(%rbp),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13b1 <main+0x291>
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     12d8 <main+0x1b8>
movslq -0x8(%rbp),%rax
mov    -0x70(%rbp,%rax,1),%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0xe0(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12a5 <main+0x185>
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movsbl -0xe0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     13a7 <main+0x287>
movslq -0x8(%rbp),%rax
movsbl -0xe0(%rbp,%rax,1),%eax
ff
mov    %eax,-0xe4(%rbp)
movl   $0x0,-0xec(%rbp)
movl   $0x0,-0xe8(%rbp)
movslq -0xec(%rbp),%rax
movsbl -0xe0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     137f <main+0x25f>
movslq -0xec(%rbp),%rax
movsbl -0xe0(%rbp,%rax,1),%eax
ff
cmp    -0xe4(%rbp),%eax
jne    136b <main+0x24b>
mov    -0xe8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xe8(%rbp)
movslq -0xec(%rbp),%rax
movb   $0x30,-0xe0(%rbp,%rax,1)
30
mov    -0xec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xec(%rbp)
jmp    131a <main+0x1fa>
mov    -0xe4(%rbp),%esi
mov    -0xe8(%rbp),%edx
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12df <main+0x1bf>
jmp    13b1 <main+0x291>
jmp    13b1 <main+0x291>
lea    0xdbf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x74(%rbp)
jne    1140 <main+0x20>
mov    -0x4(%rbp),%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xe8,%rsp
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x11(%rsp),%r13
lea    0xf54(%rip),%rbx
lea    0xfde(%rip),%rbp
lea    0xc(%rsp),%r14
lea    0xfd5(%rip),%r12
jmp    11d3 <main+0x93>
lea    0xf59(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf61(%rip),%rdi
lea    0x80(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf44(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xfb2(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,0xc(%rsp)
je     1324 <main+0x1e4>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe6a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe8c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
nop
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x3,%eax
ja     1220 <main+0xe0>
cmp    $0x1,%eax
je     1180 <main+0x40>
cmp    $0x3,%eax
je     1290 <main+0x150>
cmp    $0x2,%eax
jne    11bc <main+0x7c>
mov    $0xffffffff,%esi
lea    0x80(%rsp),%rax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%esi
cmpb   $0x0,(%rax)
lea    0x1(%rax),%rax
jne    1270 <main+0x130>
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11bc <main+0x7c>
nop
mov    0x80(%rsp),%al
test   %al,%al
je     12b4 <main+0x174>
xor    %ecx,%ecx
nopl   (%rax)
mov    %al,0x10(%rsp,%rcx,1)
movzbl 0x81(%rsp,%rcx,1),%eax
add    $0x1,%rcx
test   %al,%al
jne    12a0 <main+0x160>
mov    0x10(%rsp),%cl
test   %cl,%cl
je     11bc <main+0x7c>
xor    %r15d,%r15d
mov    %ecx,%eax
cs nopw 0x0(%rax,%rax,1)
nop
xor    %edx,%edx
test   %cl,%cl
je     1300 <main+0x1c0>
mov    %r13,%rsi
jmp    12eb <main+0x1ab>
nopl   0x0(%rax,%rax,1)
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
je     1300 <main+0x1c0>
cmp    %al,%cl
jne    12e0 <main+0x1a0>
add    $0x1,%edx
movb   $0x30,-0x1(%rsi)
jmp    12e0 <main+0x1a0>
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x11(%rsp,%r15,1),%al
test   %al,%al
je     11bc <main+0x7c>
add    $0x1,%r15
mov    0x10(%rsp),%cl
jmp    12d0 <main+0x190>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [78 x i8] c"\0A programma per il calcolo della lunghezza e delle occorrenze\00"
@.str.2 = [48 x i8] c"\0A 1. Inserisci il nome di massimo 100 caratteri\00"
@.str.3 = [31 x i8] c"\0A 2. Calcolo lunghezza stringa\00"
@.str.4 = [24 x i8] c"\0A 3. Calcolo occorrenze\00"
@.str.5 = [10 x i8] c"\0A 0. EXIT\00"
@.str.6 = [33 x i8] c"\0A inserisci la tua scelta(0-3):\09\00"
@.str.7 = [3 x i8] c"%d\00"
@.str.8 = [22 x i8] c"\0A inserisci il nome:\09\00"
@.str.9 = [3 x i8] c"%s\00"
@.str.10 = [46 x i8] c"\0A IL TUO NOME E' STATO INSERITO CORRETTAMENTE\00"
@.str.11 = [44 x i8] c"\0A la lunghezza della tua stringa e' di: %d\00"
@.str.12 = [36 x i8] c"Il carattere %c si ripete %d volte\0A\00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %2 to i8*
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %78, %0
%9 = call i32 @putchar(i32 10)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @putchar(i32 10)
br label %15
15: ; preds = %15, %8
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 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* %2)
%18 = load i32, i32* %2
%19 = icmp ugt i32 %18, 3
br i1 %19, label %15, label %20
20: ; preds = %15
switch i32 %18, label %78 [
i32 1, label %24
i32 2, label %29
i32 3, label %21
]
21: ; preds = %20
%22 = load i8, i8* %4
%23 = icmp eq i8 %22, 0
br i1 %23, label %38, label %41
24: ; preds = %20
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0))
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %4)
%27 = call i32 @putchar(i32 10)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.10, i64 0, i64 0))
br label %78
29: ; preds = %20, %29
%30 = phi i64 [ %34, %29 ], [ 0, %20 ]
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 0
%34 = add nuw i64 %30, 1
br i1 %33, label %35, label %29
35: ; preds = %29
%36 = trunc i64 %30 to i32
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0), i32 %36)
br label %78
38: ; preds = %41, %21
%39 = load i8, i8* %6
%40 = icmp eq i8 %39, 0
br i1 %40, label %78, label %49
41: ; preds = %21, %41
%42 = phi i64 [ %45, %41 ], [ 0, %21 ]
%43 = phi i8 [ %47, %41 ], [ %22, %21 ]
%44 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %42
store i8 %43, i8* %44
%45 = add nuw nsw i64 %42, 1
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %45
%47 = load i8, i8* %46
%48 = icmp eq i8 %47, 0
br i1 %48, label %38, label %41
49: ; preds = %38, %76
%50 = phi i8 [ %77, %76 ], [ %39, %38 ]
%51 = phi i64 [ %72, %76 ], [ 0, %38 ]
%52 = phi i8 [ %74, %76 ], [ %39, %38 ]
%53 = sext i8 %52 to i32
%54 = icmp eq i8 %50, 0
br i1 %54, label %69, label %55
55: ; preds = %49, %63
%56 = phi i64 [ %65, %63 ], [ 0, %49 ]
%57 = phi i8 [ %67, %63 ], [ %50, %49 ]
%58 = phi i8* [ %66, %63 ], [ %6, %49 ]
%59 = phi i32 [ %64, %63 ], [ 0, %49 ]
%60 = icmp eq i8 %57, %52
br i1 %60, label %61, label %63
61: ; preds = %55
%62 = add nsw i32 %59, 1
store i8 48, i8* %58
br label %63
63: ; preds = %61, %55
%64 = phi i32 [ %62, %61 ], [ %59, %55 ]
%65 = add nuw i64 %56, 1
%66 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %65
%67 = load i8, i8* %66
%68 = icmp eq i8 %67, 0
br i1 %68, label %69, label %55
69: ; preds = %63, %49
%70 = phi i32 [ 0, %49 ], [ %64, %63 ]
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0), i32 %53, i32 %70)
%72 = add nuw i64 %51, 1
%73 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %72
%74 = load i8, i8* %73
%75 = icmp eq i8 %74, 0
br i1 %75, label %78, label %76
76: ; preds = %69
%77 = load i8, i8* %6
br label %49
78: ; preds = %69, %38, %20, %35, %24
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%80 = load i32, i32* %2
%81 = icmp eq i32 %80, 0
br i1 %81, label %82, label %8
82: ; preds = %78
ret i32 0
}