#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);
int /*<<< orphan*/ scanf(char *, int *);
void wczyt_vat(float matrix[][5], int max_y) {
  int i;
  int buf = 1;
  for (i = 0; i < max_y; i++) {
    buf = 1;
    do {
      printf(
          "Podaj stawke VAT towaru %d (dopuszczalne wartosci: 0, 5, 8, 23): ",
          i + 1);
      scanf("%d", &buf);
      if (buf == 0 || buf == 5 || buf == 8 || buf == 23) {
        break;
      }
    } while (1 == 1);
    matrix[1][i] = (float)buf;
  }
}


x86 assembly (clang, -O0):
<wczyt_vat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d4 <wczyt_vat+0xb4>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%esi
add    $0x1,%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x14(%rbp)
je     119a <wczyt_vat+0x7a>
cmpl   $0x5,-0x14(%rbp)
je     119a <wczyt_vat+0x7a>
cmpl   $0x8,-0x14(%rbp)
je     119a <wczyt_vat+0x7a>
cmpl   $0x17,-0x14(%rbp)
jne    119f <wczyt_vat+0x7f>
jmp    11b3 <wczyt_vat+0x93>
jmp    11a4 <wczyt_vat+0x84>
mov    $0x1,%al
test   $0x1,%al
jne    1150 <wczyt_vat+0x30>
jmp    11b3 <wczyt_vat+0x93>
cvtsi2ssl -0x14(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,0x14(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <wczyt_vat+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wczyt_vat>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
test   %esi,%esi
jle    11b0 <wczyt_vat+0x90>
mov    %esi,%eax
mov    %rax,0x8(%rsp)
xor    %r14d,%r14d
lea    0xeb8(%rip),%r15
lea    0xef3(%rip),%r12
lea    0x4(%rsp),%r13
mov    $0x800121,%ebp
nopl   0x0(%rax)
movl   $0x1,0x4(%rsp)
lea    0x1(%r14),%rbx
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x17,%eax
ja     1170 <wczyt_vat+0x50>
bt     %eax,%ebp
jae    1170 <wczyt_vat+0x50>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mov    0x10(%rsp),%rax
movss  %xmm0,0x14(%rax,%r14,4)
mov    %rbx,%r14
cmp    0x8(%rsp),%rbx
jne    1160 <wczyt_vat+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [66 x i8] c"Podaj stawke VAT towaru %d (dopuszczalne wartosci: 0, 5, 8, 23): \00"
@.str.1 = [3 x i8] c"%d\00"
define void @wczyt_vat([5 x float]* %0, i32 %1) {
%3 = alloca [5 x float]*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store [5 x float]* %0, [5 x float]** %3
store i32 %1, i32* %4
store i32 1, i32* %6
store i32 0, i32* %5
br label %7
7: ; preds = %39, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %42
11: ; preds = %7
store i32 1, i32* %6
br label %12
12: ; preds = %30, %11
%13 = load i32, i32* %5
%14 = add nsw i32 %13, 1
%15 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 0
br i1 %18, label %28, label %19
19: ; preds = %12
%20 = load i32, i32* %6
%21 = icmp eq i32 %20, 5
br i1 %21, label %28, label %22
22: ; preds = %19
%23 = load i32, i32* %6
%24 = icmp eq i32 %23, 8
br i1 %24, label %28, label %25
25: ; preds = %22
%26 = load i32, i32* %6
%27 = icmp eq i32 %26, 23
br i1 %27, label %28, label %29
28: ; preds = %25, %22, %19, %12
br label %31
29: ; preds = %25
br label %30
30: ; preds = %29
br i1 true, label %12, label %31
31: ; preds = %30, %28
%32 = load i32, i32* %6
%33 = sitofp i32 %32 to float
%34 = load [5 x float]*, [5 x float]** %3
%35 = getelementptr inbounds [5 x float], [5 x float]* %34, i64 1
%36 = load i32, i32* %5
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds [5 x float], [5 x float]* %35, i64 0, i64 %37
store float %33, float* %38
br label %39
39: ; preds = %31
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %7
42: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [66 x i8] c"Podaj stawke VAT towaru %d (dopuszczalne wartosci: 0, 5, 8, 23): \00"
@.str.1 = [3 x i8] c"%d\00"
define void @wczyt_vat([5 x float]* nocapture writeonly %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %20
6: ; preds = %2
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %16
%9 = phi i64 [ 0, %6 ], [ %10, %16 ]
store i32 1, i32* %3
%10 = add nuw nsw i64 %9, 1
%11 = trunc i64 %10 to i32
br label %12
12: ; preds = %12, %8
%13 = call i32 @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str, i64 0, i64 0), i32 %11)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%15 = load i32, i32* %3
switch i32 %15, label %12 [
i32 23, label %16
i32 8, label %16
i32 5, label %16
i32 0, label %16
]
16: ; preds = %12, %12, %12, %12
%17 = sitofp i32 %15 to float
%18 = getelementptr inbounds [5 x float], [5 x float]* %0, i64 1, i64 %9
store float %17, float* %18
%19 = icmp eq i64 %10, %7
br i1 %19, label %20, label %8
20: ; preds = %16, %2
ret void
}