#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 atoi(char *);
scalar_t__ pow(double, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ sqrt(double);
void tablice() {
  char dane = 'w';
  char pom[20];
  int tab[100];
  int a, b, il = 0, i;
  printf("Kalkulator:\n");
  while (dane != 'q') {
    scanf("%s", &dane);
    switch (dane) {
    case '^':
      if (il > 1) {
        a = tab[--il];
        b = tab[--il];
        tab[il++] = (int)pow((double)b, (double)a);
      } else
        printf("W tablicy jest za mało elementów!\n");
      break;
    case 'p':
      if (il > 0) {
        a = tab[--il];
        tab[il++] = (int)sqrt((double)a);
      } else
        printf("Tablica jest pusta!\n");
      break;
    case '+':
      if (il > 1) {
        a = tab[--il];
        b = tab[--il];
        tab[il++] = b + a;
      } else
        printf("W tablicy jest za mało elementów!\n");
      break;
    case '-':
      if (il > 1) {
        a = tab[--il];
        b = tab[--il];
        tab[il++] = b - a;
      } else
        printf("W tablicy jest za mało elementów!\n");
      break;
    case '/':
      if (il > 1) {
        a = tab[--il];
        b = tab[--il];
        tab[il++] = b / a;
      } else
        printf("W tablicy jest za mało elementów!\n");
      break;
    case '*':
      if (il > 1) {
        a = tab[--il];
        b = tab[--il];
        tab[il++] = b * a;
      } else
        printf("W tablicy jest za mało elementów!\n");
      break;
    case '?':
      i = 0;
      for (i = 0; i < il; i++)
        printf("%d ", tab[i]);
      printf("\n");
      break;
    case '#':
      if (il > 0)
        il--;
      else
        printf("Tablica jest pusta!\n");
      break;
    case '&':
      if (il > 0)
        tab[il] = tab[il - 1];
      else
        printf("Tablica jest pusta!\n");
      il++;
      break;
    case '$':
      if (il > 1) {
        a = tab[--il];
        b = tab[--il];
        tab[il++] = a;
        tab[il++] = b;
      } else
        printf("W tablicy jest za mało elementów!\n");
      break;
    case 'q':
      break;
    default:
      tab[il++] = atoi(&dane);
    }
  }
}


x86 assembly (clang, -O0):
<tablice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
movb   $0x77,-0x1(%rbp)
movl   $0x0,-0x1bc(%rbp)
lea    0xfcc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x71,%eax
je     16a3 <tablice+0x553>
lea    0xfbe(%rip),%rdi
lea    -0x1(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x1(%rbp),%eax
add    $0xffffffdd,%eax
mov    %eax,%ecx
mov    %rcx,-0x1c8(%rbp)
sub    $0x4e,%eax
ja     1679 <tablice+0x529>
mov    -0x1c8(%rbp),%rax
lea    0xe45(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x1,-0x1bc(%rbp)
jle    1243 <tablice+0xf3>
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cltq
mov    -0x1b0(%rbp,%rax,4),%eax
mov    %eax,-0x1b4(%rbp)
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cltq
mov    -0x1b0(%rbp,%rax,4),%eax
mov    %eax,-0x1b8(%rbp)
cvtsi2sdl -0x1b8(%rbp),%xmm0
ff
cvtsi2sdl -0x1b4(%rbp),%xmm1
ff
call   1050 <pow@plt>
mov    %eax,%ecx
mov    -0x1bc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x1bc(%rbp)
cltq
mov    %ecx,-0x1b0(%rbp,%rax,4)
jmp    1251 <tablice+0x101>
lea    0xf02(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    169e <tablice+0x54e>
cmpl   $0x0,-0x1bc(%rbp)
jle    12af <tablice+0x15f>
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cltq
mov    -0x1b0(%rbp,%rax,4),%eax
mov    %eax,-0x1b4(%rbp)
cvtsi2sdl -0x1b4(%rbp),%xmm0
ff
call   1070 <sqrt@plt>
mov    %eax,%ecx
mov    -0x1bc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x1bc(%rbp)
cltq
mov    %ecx,-0x1b0(%rbp,%rax,4)
jmp    12bd <tablice+0x16d>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    169e <tablice+0x54e>
cmpl   $0x1,-0x1bc(%rbp)
jle    1336 <tablice+0x1e6>
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cltq
mov    -0x1b0(%rbp,%rax,4),%eax
mov    %eax,-0x1b4(%rbp)
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cltq
mov    -0x1b0(%rbp,%rax,4),%eax
mov    %eax,-0x1b8(%rbp)
mov    -0x1b8(%rbp),%ecx
add    -0x1b4(%rbp),%ecx
mov    -0x1bc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x1bc(%rbp)
cltq
mov    %ecx,-0x1b0(%rbp,%rax,4)
jmp    1344 <tablice+0x1f4>
lea    0xe0f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    169e <tablice+0x54e>
cmpl   $0x1,-0x1bc(%rbp)
jle    13bd <tablice+0x26d>
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cltq
mov    -0x1b0(%rbp,%rax,4),%eax
mov    %eax,-0x1b4(%rbp)
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cltq
mov    -0x1b0(%rbp,%rax,4),%eax
mov    %eax,-0x1b8(%rbp)
mov    -0x1b8(%rbp),%ecx
sub    -0x1b4(%rbp),%ecx
mov    -0x1bc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x1bc(%rbp)
cltq
mov    %ecx,-0x1b0(%rbp,%rax,4)
jmp    13cb <tablice+0x27b>
lea    0xd88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    169e <tablice+0x54e>
cmpl   $0x1,-0x1bc(%rbp)
jle    1447 <tablice+0x2f7>
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cltq
mov    -0x1b0(%rbp,%rax,4),%eax
mov    %eax,-0x1b4(%rbp)
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cltq
mov    -0x1b0(%rbp,%rax,4),%eax
mov    %eax,-0x1b8(%rbp)
mov    -0x1b8(%rbp),%eax
cltd
idivl  -0x1b4(%rbp)
mov    %eax,%ecx
mov    -0x1bc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x1bc(%rbp)
cltq
mov    %ecx,-0x1b0(%rbp,%rax,4)
jmp    1455 <tablice+0x305>
lea    0xcfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    169e <tablice+0x54e>
cmpl   $0x1,-0x1bc(%rbp)
jle    14cf <tablice+0x37f>
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cltq
mov    -0x1b0(%rbp,%rax,4),%eax
mov    %eax,-0x1b4(%rbp)
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cltq
mov    -0x1b0(%rbp,%rax,4),%eax
mov    %eax,-0x1b8(%rbp)
mov    -0x1b8(%rbp),%ecx
imul   -0x1b4(%rbp),%ecx
mov    -0x1bc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x1bc(%rbp)
cltq
mov    %ecx,-0x1b0(%rbp,%rax,4)
jmp    14dd <tablice+0x38d>
lea    0xc76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    169e <tablice+0x54e>
movl   $0x0,-0x1c0(%rbp)
movl   $0x0,-0x1c0(%rbp)
mov    -0x1c0(%rbp),%eax
cmp    -0x1bc(%rbp),%eax
jge    1538 <tablice+0x3e8>
movslq -0x1c0(%rbp),%rax
mov    -0x1b0(%rbp,%rax,4),%esi
lea    0xc69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c0(%rbp)
jmp    14f6 <tablice+0x3a6>
lea    0xc45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    169e <tablice+0x54e>
cmpl   $0x0,-0x1bc(%rbp)
jle    156c <tablice+0x41c>
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
jmp    157a <tablice+0x42a>
lea    0xbfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    169e <tablice+0x54e>
cmpl   $0x0,-0x1bc(%rbp)
jle    15b1 <tablice+0x461>
mov    -0x1bc(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x1b0(%rbp,%rax,4),%ecx
movslq -0x1bc(%rbp),%rax
mov    %ecx,-0x1b0(%rbp,%rax,4)
jmp    15bf <tablice+0x46f>
lea    0xbb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1bc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1bc(%rbp)
jmp    169e <tablice+0x54e>
cmpl   $0x1,-0x1bc(%rbp)
jle    1661 <tablice+0x511>
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cltq
mov    -0x1b0(%rbp,%rax,4),%eax
mov    %eax,-0x1b4(%rbp)
mov    -0x1bc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1bc(%rbp)
cltq
mov    -0x1b0(%rbp,%rax,4),%eax
mov    %eax,-0x1b8(%rbp)
mov    -0x1b4(%rbp),%ecx
mov    -0x1bc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x1bc(%rbp)
cltq
mov    %ecx,-0x1b0(%rbp,%rax,4)
mov    -0x1b8(%rbp),%ecx
mov    -0x1bc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x1bc(%rbp)
cltq
mov    %ecx,-0x1b0(%rbp,%rax,4)
jmp    166f <tablice+0x51f>
lea    0xae4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    169e <tablice+0x54e>
jmp    169e <tablice+0x54e>
lea    -0x1(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,%ecx
mov    -0x1bc(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x1bc(%rbp)
cltq
mov    %ecx,-0x1b0(%rbp,%rax,4)
jmp    1177 <tablice+0x27>
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tablice>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1a8,%rsp
movb   $0x77,0xf(%rsp)
lea    0xfb6(%rip),%rdi
call   1040 <puts@plt>
lea    0xfa3(%rip),%r14
lea    0xf(%rsp),%rbp
lea    0xe5b(%rip),%r13
lea    0xfb7(%rip),%r12
lea    0xf8c(%rip),%rbx
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbp,%rsi
call   1060 <scanf@plt>
movsbl 0xf(%rsp),%eax
lea    -0x23(%rax),%ecx
cmp    $0x4e,%ecx
ja     121b <tablice+0xab>
movslq 0x0(%r13,%rcx,4),%rcx
add    %r13,%rcx
jmp    *%rcx
test   %r15d,%r15d
jle    139e <tablice+0x22e>
add    $0xffffffff,%r15d
jmp    13c0 <tablice+0x250>
cmp    $0x2,%r15d
jl     1370 <tablice+0x200>
lea    -0x1(%r15),%eax
mov    0x10(%rsp,%rax,4),%ecx
lea    -0x2(%r15),%edx
mov    0x10(%rsp,%rdx,4),%esi
mov    %ecx,0x10(%rsp,%rdx,4)
mov    %esi,0x10(%rsp,%rax,4)
jmp    13c0 <tablice+0x250>
mov    %rbp,%rdi
call   1080 <atoi@plt>
movslq %r15d,%rcx
add    $0x1,%r15d
mov    %eax,0x10(%rsp,%rcx,4)
jmp    13c0 <tablice+0x250>
test   %r15d,%r15d
jle    13ac <tablice+0x23c>
lea    -0x1(%r15),%eax
mov    0x10(%rsp,%rax,4),%eax
mov    %r15d,%ecx
mov    %eax,0x10(%rsp,%rcx,4)
jmp    13b8 <tablice+0x248>
cmp    $0x2,%r15d
jl     1370 <tablice+0x200>
lea    -0x1(%r15),%eax
add    $0xfffffffe,%r15d
mov    0x10(%rsp,%r15,4),%ecx
imul   0x10(%rsp,%rax,4),%ecx
mov    %ecx,0x10(%rsp,%r15,4)
mov    %eax,%r15d
jmp    13c0 <tablice+0x250>
cmp    $0x2,%r15d
jl     1370 <tablice+0x200>
lea    -0x1(%r15),%eax
mov    0x10(%rsp,%rax,4),%ecx
add    $0xfffffffe,%r15d
add    %ecx,0x10(%rsp,%r15,4)
mov    %eax,%r15d
jmp    13c0 <tablice+0x250>
cmp    $0x2,%r15d
jl     1370 <tablice+0x200>
lea    -0x1(%r15),%eax
mov    0x10(%rsp,%rax,4),%ecx
add    $0xfffffffe,%r15d
sub    %ecx,0x10(%rsp,%r15,4)
mov    %eax,%r15d
jmp    13c0 <tablice+0x250>
cmp    $0x2,%r15d
jl     1370 <tablice+0x200>
lea    -0x1(%r15),%ecx
add    $0xfffffffe,%r15d
mov    0x10(%rsp,%r15,4),%eax
cltd
idivl  0x10(%rsp,%rcx,4)
mov    %eax,0x10(%rsp,%r15,4)
mov    %ecx,%r15d
jmp    13c0 <tablice+0x250>
mov    %r14,%rbp
test   %r15d,%r15d
jle    1318 <tablice+0x1a8>
mov    %r15d,%r12d
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
mov    0x10(%rsp,%r14,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r14
cmp    %r14,%r12
jne    1300 <tablice+0x190>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbp,%r14
lea    0xf(%rsp),%rbp
lea    0xe32(%rip),%r12
jmp    13c0 <tablice+0x250>
cmp    $0x2,%r15d
jl     1370 <tablice+0x200>
lea    -0x1(%r15),%ebx
add    $0xfffffffe,%r15d
xorps  %xmm0,%xmm0
cvtsi2sdl 0x10(%rsp,%r15,4),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x10(%rsp,%rbx,4),%xmm1
call   1070 <pow@plt>
mov    %eax,0x10(%rsp,%r15,4)
mov    %ebx,%r15d
lea    0xdd4(%rip),%rbx
jmp    13c0 <tablice+0x250>
nopl   (%rax)
mov    %r12,%rdi
call   1040 <puts@plt>
jmp    13c0 <tablice+0x250>
test   %r15d,%r15d
jle    139e <tablice+0x22e>
lea    -0x1(%r15),%ebx
xorps  %xmm0,%xmm0
cvtsi2sdl 0x10(%rsp,%rbx,4),%xmm0
call   1090 <sqrt@plt>
mov    %eax,0x10(%rsp,%rbx,4)
lea    0xda3(%rip),%rbx
jmp    13c0 <tablice+0x250>
lea    0xdaa(%rip),%rdi
call   1040 <puts@plt>
jmp    13c0 <tablice+0x250>
lea    0xd9c(%rip),%rdi
call   1040 <puts@plt>
add    $0x1,%r15d
nopl   0x0(%rax)
mov    0xf(%rsp),%al
cmp    $0x71,%al
jne    11c0 <tablice+0x50>
add    $0x1a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Kalkulator:\0A\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [37 x i8] c"W tablicy jest za ma\C5\82o element\C3\B3w!\0A\00"
@.str.3 = [21 x i8] c"Tablica jest pusta!\0A\00"
@.str.4 = [4 x i8] c"%d \00"
@.str.5 = [2 x i8] c"\0A\00"
define void @tablice() {
%1 = alloca i8
%2 = alloca [20 x i8]
%3 = alloca [100 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8 119, i8* %1
store i32 0, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %236, %0
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 113
br i1 %12, label %13, label %237
13: ; preds = %9
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%15 = load i8, i8* %1
%16 = sext i8 %15 to i32
switch i32 %16, label %230 [
i32 94, label %17
i32 112, label %44
i32 43, label %64
i32 45, label %88
i32 47, label %112
i32 42, label %136
i32 63, label %160
i32 35, label %176
i32 38, label %185
i32 36, label %202
i32 113, label %229
]
17: ; preds = %13
%18 = load i32, i32* %6
%19 = icmp sgt i32 %18, 1
br i1 %19, label %20, label %41
20: ; preds = %17
%21 = load i32, i32* %6
%22 = add nsw i32 %21, -1
store i32 %22, i32* %6
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %23
%25 = load i32, i32* %24
store i32 %25, i32* %4
%26 = load i32, i32* %6
%27 = add nsw i32 %26, -1
store i32 %27, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %28
%30 = load i32, i32* %29
store i32 %30, i32* %5
%31 = load i32, i32* %5
%32 = sitofp i32 %31 to double
%33 = load i32, i32* %4
%34 = sitofp i32 %33 to double
%35 = call i64 @pow(double %32, double %34)
%36 = trunc i64 %35 to i32
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %6
%39 = sext i32 %37 to i64
%40 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %39
store i32 %36, i32* %40
br label %43
41: ; preds = %17
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %43
43: ; preds = %41, %20
br label %236
44: ; preds = %13
%45 = load i32, i32* %6
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %61
47: ; preds = %44
%48 = load i32, i32* %6
%49 = add nsw i32 %48, -1
store i32 %49, i32* %6
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %50
%52 = load i32, i32* %51
store i32 %52, i32* %4
%53 = load i32, i32* %4
%54 = sitofp i32 %53 to double
%55 = call i64 @sqrt(double %54)
%56 = trunc i64 %55 to i32
%57 = load i32, i32* %6
%58 = add nsw i32 %57, 1
store i32 %58, i32* %6
%59 = sext i32 %57 to i64
%60 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %59
store i32 %56, i32* %60
br label %63
61: ; preds = %44
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %63
63: ; preds = %61, %47
br label %236
64: ; preds = %13
%65 = load i32, i32* %6
%66 = icmp sgt i32 %65, 1
br i1 %66, label %67, label %85
67: ; preds = %64
%68 = load i32, i32* %6
%69 = add nsw i32 %68, -1
store i32 %69, i32* %6
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %70
%72 = load i32, i32* %71
store i32 %72, i32* %4
%73 = load i32, i32* %6
%74 = add nsw i32 %73, -1
store i32 %74, i32* %6
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %75
%77 = load i32, i32* %76
store i32 %77, i32* %5
%78 = load i32, i32* %5
%79 = load i32, i32* %4
%80 = add nsw i32 %78, %79
%81 = load i32, i32* %6
%82 = add nsw i32 %81, 1
store i32 %82, i32* %6
%83 = sext i32 %81 to i64
%84 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %83
store i32 %80, i32* %84
br label %87
85: ; preds = %64
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %87
87: ; preds = %85, %67
br label %236
88: ; preds = %13
%89 = load i32, i32* %6
%90 = icmp sgt i32 %89, 1
br i1 %90, label %91, label %109
91: ; preds = %88
%92 = load i32, i32* %6
%93 = add nsw i32 %92, -1
store i32 %93, i32* %6
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %94
%96 = load i32, i32* %95
store i32 %96, i32* %4
%97 = load i32, i32* %6
%98 = add nsw i32 %97, -1
store i32 %98, i32* %6
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %99
%101 = load i32, i32* %100
store i32 %101, i32* %5
%102 = load i32, i32* %5
%103 = load i32, i32* %4
%104 = sub nsw i32 %102, %103
%105 = load i32, i32* %6
%106 = add nsw i32 %105, 1
store i32 %106, i32* %6
%107 = sext i32 %105 to i64
%108 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %107
store i32 %104, i32* %108
br label %111
109: ; preds = %88
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %111
111: ; preds = %109, %91
br label %236
112: ; preds = %13
%113 = load i32, i32* %6
%114 = icmp sgt i32 %113, 1
br i1 %114, label %115, label %133
115: ; preds = %112
%116 = load i32, i32* %6
%117 = add nsw i32 %116, -1
store i32 %117, i32* %6
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %118
%120 = load i32, i32* %119
store i32 %120, i32* %4
%121 = load i32, i32* %6
%122 = add nsw i32 %121, -1
store i32 %122, i32* %6
%123 = sext i32 %122 to i64
%124 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %123
%125 = load i32, i32* %124
store i32 %125, i32* %5
%126 = load i32, i32* %5
%127 = load i32, i32* %4
%128 = sdiv i32 %126, %127
%129 = load i32, i32* %6
%130 = add nsw i32 %129, 1
store i32 %130, i32* %6
%131 = sext i32 %129 to i64
%132 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %131
store i32 %128, i32* %132
br label %135
133: ; preds = %112
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %135
135: ; preds = %133, %115
br label %236
136: ; preds = %13
%137 = load i32, i32* %6
%138 = icmp sgt i32 %137, 1
br i1 %138, label %139, label %157
139: ; preds = %136
%140 = load i32, i32* %6
%141 = add nsw i32 %140, -1
store i32 %141, i32* %6
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %142
%144 = load i32, i32* %143
store i32 %144, i32* %4
%145 = load i32, i32* %6
%146 = add nsw i32 %145, -1
store i32 %146, i32* %6
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %147
%149 = load i32, i32* %148
store i32 %149, i32* %5
%150 = load i32, i32* %5
%151 = load i32, i32* %4
%152 = mul nsw i32 %150, %151
%153 = load i32, i32* %6
%154 = add nsw i32 %153, 1
store i32 %154, i32* %6
%155 = sext i32 %153 to i64
%156 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %155
store i32 %152, i32* %156
br label %159
157: ; preds = %136
%158 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %159
159: ; preds = %157, %139
br label %236
160: ; preds = %13
store i32 0, i32* %7
store i32 0, i32* %7
br label %161
161: ; preds = %171, %160
%162 = load i32, i32* %7
%163 = load i32, i32* %6
%164 = icmp slt i32 %162, %163
br i1 %164, label %165, label %174
165: ; preds = %161
%166 = load i32, i32* %7
%167 = sext i32 %166 to i64
%168 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %167
%169 = load i32, i32* %168
%170 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %169)
br label %171
171: ; preds = %165
%172 = load i32, i32* %7
%173 = add nsw i32 %172, 1
store i32 %173, i32* %7
br label %161
174: ; preds = %161
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %236
176: ; preds = %13
%177 = load i32, i32* %6
%178 = icmp sgt i32 %177, 0
br i1 %178, label %179, label %182
179: ; preds = %176
%180 = load i32, i32* %6
%181 = add nsw i32 %180, -1
store i32 %181, i32* %6
br label %184
182: ; preds = %176
%183 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %184
184: ; preds = %182, %179
br label %236
185: ; preds = %13
%186 = load i32, i32* %6
%187 = icmp sgt i32 %186, 0
br i1 %187, label %188, label %197
188: ; preds = %185
%189 = load i32, i32* %6
%190 = sub nsw i32 %189, 1
%191 = sext i32 %190 to i64
%192 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %191
%193 = load i32, i32* %192
%194 = load i32, i32* %6
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %195
store i32 %193, i32* %196
br label %199
197: ; preds = %185
%198 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %199
199: ; preds = %197, %188
%200 = load i32, i32* %6
%201 = add nsw i32 %200, 1
store i32 %201, i32* %6
br label %236
202: ; preds = %13
%203 = load i32, i32* %6
%204 = icmp sgt i32 %203, 1
br i1 %204, label %205, label %226
205: ; preds = %202
%206 = load i32, i32* %6
%207 = add nsw i32 %206, -1
store i32 %207, i32* %6
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %208
%210 = load i32, i32* %209
store i32 %210, i32* %4
%211 = load i32, i32* %6
%212 = add nsw i32 %211, -1
store i32 %212, i32* %6
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %213
%215 = load i32, i32* %214
store i32 %215, i32* %5
%216 = load i32, i32* %4
%217 = load i32, i32* %6
%218 = add nsw i32 %217, 1
store i32 %218, i32* %6
%219 = sext i32 %217 to i64
%220 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %219
store i32 %216, i32* %220
%221 = load i32, i32* %5
%222 = load i32, i32* %6
%223 = add nsw i32 %222, 1
store i32 %223, i32* %6
%224 = sext i32 %222 to i64
%225 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %224
store i32 %221, i32* %225
br label %228
226: ; preds = %202
%227 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %228
228: ; preds = %226, %205
br label %236
229: ; preds = %13
br label %236
230: ; preds = %13
%231 = call i32 @atoi(i8* %1)
%232 = load i32, i32* %6
%233 = add nsw i32 %232, 1
store i32 %233, i32* %6
%234 = sext i32 %232 to i64
%235 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %234
store i32 %231, i32* %235
br label %236
236: ; preds = %230, %229, %228, %199, %184, %174, %159, %135, %111, %87, %63, %43
br label %9
237: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.4 = [4 x i8] c"%d \00"
@str = [12 x i8] c"Kalkulator:\00"
@str.13 = [20 x i8] c"Tablica jest pusta!\00"
@str.14 = [36 x i8] c"W tablicy jest za ma\C5\82o element\C3\B3w!\00"
define void @tablice() {
%1 = alloca i8
%2 = alloca [100 x i32]
store i8 119, i8* %1
%3 = bitcast [100 x i32]* %2 to i8*
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
br label %5
5: ; preds = %0, %148
%6 = phi i32 [ %150, %148 ], [ 0, %0 ]
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
switch i32 %9, label %140 [
i32 94, label %14
i32 112, label %31
i32 43, label %43
i32 45, label %57
i32 47, label %71
i32 42, label %85
i32 63, label %10
i32 35, label %108
i32 38, label %114
i32 36, label %127
i32 113, label %148
]
10: ; preds = %5
%11 = icmp sgt i32 %6, 0
br i1 %11, label %12, label %106
12: ; preds = %10
%13 = zext i32 %6 to i64
br label %99
14: ; preds = %5
%15 = icmp sgt i32 %6, 1
br i1 %15, label %16, label %29
16: ; preds = %14
%17 = add nsw i32 %6, -1
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = add nsw i32 %6, -2
%22 = zext i32 %21 to i64
%23 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = sitofp i32 %24 to double
%26 = sitofp i32 %20 to double
%27 = call i64 @pow(double %25, double %26)
%28 = trunc i64 %27 to i32
store i32 %28, i32* %23
br label %145
29: ; preds = %14
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.14, i64 0, i64 0))
br label %145
31: ; preds = %5
%32 = icmp sgt i32 %6, 0
br i1 %32, label %33, label %41
33: ; preds = %31
%34 = add nsw i32 %6, -1
%35 = zext i32 %34 to i64
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = sitofp i32 %37 to double
%39 = call i64 @sqrt(double %38)
%40 = trunc i64 %39 to i32
store i32 %40, i32* %36
br label %145
41: ; preds = %31
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.13, i64 0, i64 0))
br label %145
43: ; preds = %5
%44 = icmp sgt i32 %6, 1
br i1 %44, label %45, label %55
45: ; preds = %43
%46 = add nsw i32 %6, -1
%47 = zext i32 %46 to i64
%48 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %47
%49 = load i32, i32* %48
%50 = add nsw i32 %6, -2
%51 = zext i32 %50 to i64
%52 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %51
%53 = load i32, i32* %52
%54 = add nsw i32 %53, %49
store i32 %54, i32* %52
br label %145
55: ; preds = %43
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.14, i64 0, i64 0))
br label %145
57: ; preds = %5
%58 = icmp sgt i32 %6, 1
br i1 %58, label %59, label %69
59: ; preds = %57
%60 = add nsw i32 %6, -1
%61 = zext i32 %60 to i64
%62 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %61
%63 = load i32, i32* %62
%64 = add nsw i32 %6, -2
%65 = zext i32 %64 to i64
%66 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %65
%67 = load i32, i32* %66
%68 = sub nsw i32 %67, %63
store i32 %68, i32* %66
br label %145
69: ; preds = %57
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.14, i64 0, i64 0))
br label %145
71: ; preds = %5
%72 = icmp sgt i32 %6, 1
br i1 %72, label %73, label %83
73: ; preds = %71
%74 = add nsw i32 %6, -1
%75 = zext i32 %74 to i64
%76 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %75
%77 = load i32, i32* %76
%78 = add nsw i32 %6, -2
%79 = zext i32 %78 to i64
%80 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %79
%81 = load i32, i32* %80
%82 = sdiv i32 %81, %77
store i32 %82, i32* %80
br label %145
83: ; preds = %71
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.14, i64 0, i64 0))
br label %145
85: ; preds = %5
%86 = icmp sgt i32 %6, 1
br i1 %86, label %87, label %97
87: ; preds = %85
%88 = add nsw i32 %6, -1
%89 = zext i32 %88 to i64
%90 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %89
%91 = load i32, i32* %90
%92 = add nsw i32 %6, -2
%93 = zext i32 %92 to i64
%94 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %93
%95 = load i32, i32* %94
%96 = mul nsw i32 %95, %91
store i32 %96, i32* %94
br label %145
97: ; preds = %85
%98 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.14, i64 0, i64 0))
br label %145
99: ; preds = %12, %99
%100 = phi i64 [ 0, %12 ], [ %104, %99 ]
%101 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %100
%102 = load i32, i32* %101
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %102)
%104 = add nuw nsw i64 %100, 1
%105 = icmp eq i64 %104, %13
br i1 %105, label %106, label %99
106: ; preds = %99, %10
%107 = call i32 @putchar(i32 10)
br label %145
108: ; preds = %5
%109 = icmp sgt i32 %6, 0
br i1 %109, label %110, label %112
110: ; preds = %108
%111 = add nsw i32 %6, -1
br label %145
112: ; preds = %108
%113 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.13, i64 0, i64 0))
br label %145
114: ; preds = %5
%115 = icmp sgt i32 %6, 0
br i1 %115, label %116, label %123
116: ; preds = %114
%117 = add nsw i32 %6, -1
%118 = zext i32 %117 to i64
%119 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %118
%120 = load i32, i32* %119
%121 = zext i32 %6 to i64
%122 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %121
store i32 %120, i32* %122
br label %125
123: ; preds = %114
%124 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.13, i64 0, i64 0))
br label %125
125: ; preds = %123, %116
%126 = add nsw i32 %6, 1
br label %145
127: ; preds = %5
%128 = icmp sgt i32 %6, 1
br i1 %128, label %129, label %138
129: ; preds = %127
%130 = add nsw i32 %6, -1
%131 = zext i32 %130 to i64
%132 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %131
%133 = load i32, i32* %132
%134 = add nsw i32 %6, -2
%135 = zext i32 %134 to i64
%136 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %135
%137 = load i32, i32* %136
store i32 %133, i32* %136
store i32 %137, i32* %132
br label %145
138: ; preds = %127
%139 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.14, i64 0, i64 0))
br label %145
140: ; preds = %5
%141 = call i32 @atoi(i8* %1)
%142 = add nsw i32 %6, 1
%143 = sext i32 %6 to i64
%144 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %143
store i32 %141, i32* %144
br label %145
145: ; preds = %106, %125, %140, %29, %16, %41, %33, %55, %45, %69, %59, %83, %73, %97, %87, %112, %110, %138, %129
%146 = phi i32 [ %6, %29 ], [ %17, %16 ], [ %6, %41 ], [ %6, %33 ], [ %6, %55 ], [ %46, %45 ], [ %6, %69 ], [ %60, %59 ], [ %6, %83 ], [ %74, %73 ], [ %6, %97 ], [ %88, %87 ], [ %6, %106 ], [ %6, %112 ], [ %111, %110 ], [ %126, %125 ], [ %6, %138 ], [ %6, %129 ], [ %142, %140 ]
%147 = load i8, i8* %1
br label %148
148: ; preds = %145, %5
%149 = phi i8 [ %147, %145 ], [ %8, %5 ]
%150 = phi i32 [ %146, %145 ], [ %6, %5 ]
%151 = icmp eq i8 %149, 113
br i1 %151, label %152, label %5
152: ; preds = %148
ret void
}