#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*/ dzienZint(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int miesc = 1;
  int dzien = 1;
  printf("Miesiac=");
  scanf("%i", &miesc);
  printf("Dien=");
  scanf("%i", &dzien);
  printf("Miesac %i\n|", miesc);
  for (int i = 0; i < 7; i++) {
    dzienZint(i);
    printf("|");
  }
  int d = 1;
  while (d <= 31) {
    printf("\n|");
    for (int i = 0; i < 7; i++) {
      if (--dzien <= 0 && d <= 31) {
        printf("%2i|", d++);
      } else
        printf("  |");
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe89(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x7,-0x10(%rbp)
jge    11cf <main+0x9f>
mov    -0x10(%rbp),%edi
call   1040 <dzienZint@plt>
lea    0xe62(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11a1 <main+0x71>
movl   $0x1,-0x14(%rbp)
cmpl   $0x1f,-0x14(%rbp)
jg     125f <main+0x12f>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x7,-0x18(%rbp)
jge    125a <main+0x12a>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jg     1239 <main+0x109>
cmpl   $0x1f,-0x14(%rbp)
jg     1239 <main+0x109>
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1247 <main+0x117>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    124c <main+0x11c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11f5 <main+0xc5>
jmp    11d6 <main+0xa6>
lea    0xdc1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
movl   $0x1,0xc(%rsp)
movl   $0x1,0x8(%rsp)
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe98(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xe87(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0xc(%rsp),%esi
lea    0xe6e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <dzienZint@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
mov    $0x1,%edi
call   1050 <dzienZint@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    $0x2,%edi
call   1050 <dzienZint@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    $0x3,%edi
call   1050 <dzienZint@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    $0x4,%edi
call   1050 <dzienZint@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    $0x5,%edi
call   1050 <dzienZint@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
mov    $0x6,%edi
call   1050 <dzienZint@plt>
mov    $0x7c,%edi
call   1030 <putchar@plt>
lea    0xddb(%rip),%r14
lea    0xdd7(%rip),%r15
lea    0xdd5(%rip),%r12
jmp    1263 <main+0x123>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x20,%ebx
jge    1411 <main+0x2d1>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
cmp    $0x1,%eax
jg     1290 <main+0x150>
lea    0x1(%rbx),%ebp
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%ebx
jmp    129a <main+0x15a>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
cmp    $0x1,%eax
jg     12d0 <main+0x190>
cmp    $0x20,%ebx
jge    12d0 <main+0x190>
lea    0x1(%rbx),%ebp
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%ebx
jmp    12da <main+0x19a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
cmp    $0x1,%eax
jg     1310 <main+0x1d0>
cmp    $0x20,%ebx
jge    1310 <main+0x1d0>
lea    0x1(%rbx),%ebp
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%ebx
jmp    131a <main+0x1da>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
cmp    $0x1,%eax
jg     1350 <main+0x210>
cmp    $0x20,%ebx
jge    1350 <main+0x210>
lea    0x1(%rbx),%ebp
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%ebx
jmp    135a <main+0x21a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
cmp    $0x1,%eax
jg     1390 <main+0x250>
cmp    $0x20,%ebx
jge    1390 <main+0x250>
lea    0x1(%rbx),%ebp
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%ebx
jmp    139a <main+0x25a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
cmp    $0x1,%eax
jg     13d0 <main+0x290>
cmp    $0x20,%ebx
jge    13d0 <main+0x290>
lea    0x1(%rbx),%ebp
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%ebx
jmp    13da <main+0x29a>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%eax
lea    -0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
cmp    $0x1,%eax
jg     1250 <main+0x110>
cmp    $0x20,%ebx
jge    1250 <main+0x110>
lea    0x1(%rbx),%ebp
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%ebx
cmp    $0x20,%ebx
jl     1263 <main+0x123>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"Miesiac=\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [6 x i8] c"Dien=\00"
@.str.3 = [12 x i8] c"Miesac %i\0A|\00"
@.str.4 = [2 x i8] c"|\00"
@.str.5 = [3 x i8] c"\0A|\00"
@.str.6 = [5 x i8] c"%2i|\00"
@.str.7 = [4 x i8] c" |\00"
@.str.8 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 1, i32* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %11)
store i32 0, i32* %4
br label %13
13: ; preds = %20, %0
%14 = load i32, i32* %4
%15 = icmp slt i32 %14, 7
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = load i32, i32* %4
%18 = call i32 @dzienZint(i32 %17)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %20
20: ; preds = %16
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %13
23: ; preds = %13
store i32 1, i32* %5
br label %24
24: ; preds = %49, %23
%25 = load i32, i32* %5
%26 = icmp sle i32 %25, 31
br i1 %26, label %27, label %50
27: ; preds = %24
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %6
br label %29
29: ; preds = %46, %27
%30 = load i32, i32* %6
%31 = icmp slt i32 %30, 7
br i1 %31, label %32, label %49
32: ; preds = %29
%33 = load i32, i32* %3
%34 = add nsw i32 %33, -1
store i32 %34, i32* %3
%35 = icmp sle i32 %34, 0
br i1 %35, label %36, label %43
36: ; preds = %32
%37 = load i32, i32* %5
%38 = icmp sle i32 %37, 31
br i1 %38, label %39, label %43
39: ; preds = %36
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %40)
br label %45
43: ; preds = %36, %32
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %45
45: ; preds = %43, %39
br label %46
46: ; preds = %45
%47 = load i32, i32* %6
%48 = add nsw i32 %47, 1
store i32 %48, i32* %6
br label %29
49: ; preds = %29
br label %24
50: ; preds = %24
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"Miesiac=\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [6 x i8] c"Dien=\00"
@.str.3 = [12 x i8] c"Miesac %i\0A|\00"
@.str.5 = [3 x i8] c"\0A|\00"
@.str.6 = [5 x i8] c"%2i|\00"
@.str.7 = [4 x i8] c" |\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = call i32 @dzienZint(i32 0)
%12 = call i32 @putchar(i32 124)
%13 = call i32 @dzienZint(i32 1)
%14 = call i32 @putchar(i32 124)
%15 = call i32 @dzienZint(i32 2)
%16 = call i32 @putchar(i32 124)
%17 = call i32 @dzienZint(i32 3)
%18 = call i32 @putchar(i32 124)
%19 = call i32 @dzienZint(i32 4)
%20 = call i32 @putchar(i32 124)
%21 = call i32 @dzienZint(i32 5)
%22 = call i32 @putchar(i32 124)
%23 = call i32 @dzienZint(i32 6)
%24 = call i32 @putchar(i32 124)
br label %25
25: ; preds = %0, %108
%26 = phi i32 [ %109, %108 ], [ 1, %0 ]
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%28 = load i32, i32* %2
%29 = add nsw i32 %28, -1
store i32 %29, i32* %2
%30 = icmp slt i32 %28, 2
br i1 %30, label %31, label %34
31: ; preds = %25
%32 = add nsw i32 %26, 1
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %26)
br label %36
34: ; preds = %25
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %36
36: ; preds = %31, %34
%37 = phi i32 [ %32, %31 ], [ %26, %34 ]
%38 = load i32, i32* %2
%39 = add nsw i32 %38, -1
store i32 %39, i32* %2
%40 = icmp slt i32 %38, 2
%41 = icmp slt i32 %37, 32
%42 = select i1 %40, i1 %41, i1 false
br i1 %42, label %45, label %43
43: ; preds = %36
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %48
45: ; preds = %36
%46 = add nsw i32 %37, 1
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %37)
br label %48
48: ; preds = %45, %43
%49 = phi i32 [ %46, %45 ], [ %37, %43 ]
%50 = load i32, i32* %2
%51 = add nsw i32 %50, -1
store i32 %51, i32* %2
%52 = icmp slt i32 %50, 2
%53 = icmp slt i32 %49, 32
%54 = select i1 %52, i1 %53, i1 false
br i1 %54, label %57, label %55
55: ; preds = %48
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %60
57: ; preds = %48
%58 = add nsw i32 %49, 1
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %49)
br label %60
60: ; preds = %57, %55
%61 = phi i32 [ %58, %57 ], [ %49, %55 ]
%62 = load i32, i32* %2
%63 = add nsw i32 %62, -1
store i32 %63, i32* %2
%64 = icmp slt i32 %62, 2
%65 = icmp slt i32 %61, 32
%66 = select i1 %64, i1 %65, i1 false
br i1 %66, label %69, label %67
67: ; preds = %60
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %72
69: ; preds = %60
%70 = add nsw i32 %61, 1
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %61)
br label %72
72: ; preds = %69, %67
%73 = phi i32 [ %70, %69 ], [ %61, %67 ]
%74 = load i32, i32* %2
%75 = add nsw i32 %74, -1
store i32 %75, i32* %2
%76 = icmp slt i32 %74, 2
%77 = icmp slt i32 %73, 32
%78 = select i1 %76, i1 %77, i1 false
br i1 %78, label %81, label %79
79: ; preds = %72
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %84
81: ; preds = %72
%82 = add nsw i32 %73, 1
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %73)
br label %84
84: ; preds = %81, %79
%85 = phi i32 [ %82, %81 ], [ %73, %79 ]
%86 = load i32, i32* %2
%87 = add nsw i32 %86, -1
store i32 %87, i32* %2
%88 = icmp slt i32 %86, 2
%89 = icmp slt i32 %85, 32
%90 = select i1 %88, i1 %89, i1 false
br i1 %90, label %93, label %91
91: ; preds = %84
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %96
93: ; preds = %84
%94 = add nsw i32 %85, 1
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %85)
br label %96
96: ; preds = %93, %91
%97 = phi i32 [ %94, %93 ], [ %85, %91 ]
%98 = load i32, i32* %2
%99 = add nsw i32 %98, -1
store i32 %99, i32* %2
%100 = icmp slt i32 %98, 2
%101 = icmp slt i32 %97, 32
%102 = select i1 %100, i1 %101, i1 false
br i1 %102, label %105, label %103
103: ; preds = %96
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %108
105: ; preds = %96
%106 = add nsw i32 %97, 1
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %97)
br label %108
108: ; preds = %105, %103
%109 = phi i32 [ %106, %105 ], [ %97, %103 ]
%110 = icmp slt i32 %109, 32
br i1 %110, label %25, label %111
111: ; preds = %108
%112 = call i32 @putchar(i32 10)
ret i32 0
}