#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int slownie(char *, char *);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main(int argc, char *argv[]) {
  char liczba[80];
  char txt[400] = "";
  char znak;
  int poprawnych;
  do {
    printf("Podaj liczbe (maksymalnie 27 cyfr)\n");
    scanf("%s", liczba);
    poprawnych = slownie(liczba, txt);
    if (poprawnych < strlen(liczba))
      printf("podana liczba jest nieprawidlowa");
    else
      printf("%s", txt);
    printf("\nKonwertowac nastepna liczbe ? [T] - tak: ");
    fflush(stdin);
    scanf("%c", &znak);
    printf("\n");
  } while ((znak == 't') || (znak == 'T'));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1f0(%rbp),%rdi
xor    %esi,%esi
mov    $0x190,%edx
call   1050 <memset@plt>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1080 <scanf@plt>
lea    -0x60(%rbp),%rdi
lea    -0x1f0(%rbp),%rsi
call   1070 <slownie@plt>
mov    %eax,-0x1f8(%rbp)
mov    -0x1f8(%rbp),%eax
mov    %eax,-0x1fc(%rbp)
lea    -0x60(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1fc(%rbp),%eax
cmp    %ecx,%eax
jge    11f8 <main+0x98>
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    120d <main+0xad>
lea    -0x1f0(%rbp),%rsi
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2dc6(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xe43(%rip),%rdi
lea    -0x1f1(%rbp),%rsi
call   1080 <scanf@plt>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x1f1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x74,%ecx
mov    %al,-0x1fd(%rbp)
je     1275 <main+0x115>
movsbl -0x1f1(%rbp),%eax
cmp    $0x54,%eax
sete   %al
mov    %al,-0x1fd(%rbp)
mov    -0x1fd(%rbp),%al
test   $0x1,%al
jne    118c <main+0x2c>
xor    %eax,%eax
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1f8,%rsp
lea    0x60(%rsp),%r15
mov    $0x190,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
lea    0xe54(%rip),%r12
lea    0x10(%rsp),%rbx
lea    0xe97(%rip),%r13
lea    0xf(%rsp),%r14
jmp    1209 <main+0x89>
nop
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe50(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2e06(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    %r13,%rdi
mov    %r14,%rsi
call   10a0 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movzbl 0xf(%rsp),%eax
and    $0xdf,%al
cmp    $0x54,%al
jne    1249 <main+0xc9>
lea    0xe42(%rip),%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   10a0 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1090 <slownie@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    %eax,%ebp
jge    11c0 <main+0x40>
lea    0xdc3(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    11cd <main+0x4d>
xor    %eax,%eax
add    $0x1f8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Podaj liczbe (maksymalnie 27 cyfr)\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [33 x i8] c"podana liczba jest nieprawidlowa\00"
@.str.3 = [43 x i8] c"\0AKonwertowac nastepna liczbe ? [T] - tak: \00"
@stdin = global i32 0
@.str.4 = [3 x i8] c"%c\00"
@.str.5 = [2 x i8] c"\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [80 x i8]
%7 = alloca [400 x i8]
%8 = alloca i8
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = bitcast [400 x i8]* %7 to i8*
br label %11
11: ; preds = %41, %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%16 = getelementptr inbounds [400 x i8], [400 x i8]* %7, i64 0, i64 0
%17 = call i32 @slownie(i8* %15, i8* %16)
store i32 %17, i32* %9
%18 = load i32, i32* %9
%19 = getelementptr inbounds [80 x i8], [80 x i8]* %6, i64 0, i64 0
%20 = call i32 @strlen(i8* %19)
%21 = icmp slt i32 %18, %20
br i1 %21, label %22, label %24
22: ; preds = %11
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %27
24: ; preds = %11
%25 = getelementptr inbounds [400 x i8], [400 x i8]* %7, i64 0, i64 0
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %25)
br label %27
27: ; preds = %24, %22
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%29 = load i32, i32* @stdin
%30 = call i32 @fflush(i32 %29)
%31 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %8)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %33
33: ; preds = %27
%34 = load i8, i8* %8
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 116
br i1 %36, label %41, label %37
37: ; preds = %33
%38 = load i8, i8* %8
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 84
br label %41
41: ; preds = %37, %33
%42 = phi i1 [ true, %33 ], [ %40, %37 ]
br i1 %42, label %11, label %43
43: ; preds = %41
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [33 x i8] c"podana liczba jest nieprawidlowa\00"
@.str.3 = [43 x i8] c"\0AKonwertowac nastepna liczbe ? [T] - tak: \00"
@stdin = global i32 0
@.str.4 = [3 x i8] c"%c\00"
@str = [35 x i8] c"Podaj liczbe (maksymalnie 27 cyfr)\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [80 x i8]
%4 = alloca [400 x i8]
%5 = alloca i8
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [400 x i8], [400 x i8]* %4, i64 0, i64 0
br label %8
8: ; preds = %18, %2
%9 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%11 = call i32 @slownie(i8* %6, i8* %7)
%12 = call i32 @strlen(i8* %6)
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %8
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %18
16: ; preds = %8
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %18
18: ; preds = %16, %14
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0))
%20 = load i32, i32* @stdin
%21 = call i32 @fflush(i32 %20)
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %5)
%23 = call i32 @putchar(i32 10)
%24 = load i8, i8* %5
%25 = and i8 %24, -33
%26 = icmp eq i8 %25, 84
br i1 %26, label %8, label %27
27: ; preds = %18
ret i32 0
}