#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);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int dana, sati, totalSati = 0;
  int hektara;
  scanf("%d", &hektara);
  if (hektara <= 4800)
    totalSati += hektara / (15 * 8);
  else {
    totalSati += 40;
    hektara -= 4800;
    if (hektara <= 2400)
      totalSati += hektara / (15 * 5);
    else {
      totalSati += 32;
      hektara -= 2400;
      if (hektara > 0)
        totalSati += hektara / ((5 * 15) + (7 * 12));
    }
  }
  dana = totalSati / 8;
  totalSati -= dana * 8;
  sati = totalSati;
  printf("Posao je zavrsen nakon %d dana i %d sati\n", dana, sati);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x12c0,-0x14(%rbp)
jg     1169 <main+0x49>
mov    -0x14(%rbp),%eax
mov    $0x78,%ecx
cltd
idiv   %ecx
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11d9 <main+0xb9>
mov    -0x10(%rbp),%eax
add    $0x28,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x12c0,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x960,-0x14(%rbp)
jg     11a0 <main+0x80>
mov    -0x14(%rbp),%eax
mov    $0x4b,%ecx
cltd
idiv   %ecx
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11d4 <main+0xb4>
mov    -0x10(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x960,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11cf <main+0xaf>
mov    -0x14(%rbp),%eax
mov    $0x9f,%ecx
cltd
idiv   %ecx
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    11d4 <main+0xb4>
jmp    11d9 <main+0xb9>
mov    -0x10(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
shl    $0x3,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xdfb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    $0x12c0,%eax
jg     1159 <main+0x39>
movslq %eax,%rcx
imul   $0xffffffff88888889,%rcx,%rdx
shr    $0x20,%rdx
add    %eax,%edx
mov    %edx,%eax
shr    $0x1f,%eax
sar    $0x6,%edx
add    %eax,%edx
jmp    11ae <main+0x8e>
lea    -0x12c0(%rax),%ecx
mov    %ecx,0x4(%rsp)
cmp    $0x1c20,%eax
ja     118a <main+0x6a>
movzwl %cx,%eax
imul   $0xb4e9,%eax,%eax
shr    $0x10,%eax
sub    %eax,%ecx
movzwl %cx,%ecx
shr    %ecx
add    %eax,%ecx
movzwl %cx,%edx
shr    $0x6,%edx
add    $0x28,%edx
jmp    11ae <main+0x8e>
add    $0xffffe3e0,%eax
mov    %eax,0x4(%rsp)
mov    $0x9c2d14ef,%ecx
imul   %rax,%rcx
shr    $0x20,%rcx
sub    %ecx,%eax
shr    %eax
add    %ecx,%eax
shr    $0x7,%eax
add    $0x48,%eax
mov    %eax,%edx
lea    0x7(%rdx),%eax
test   %edx,%edx
cmovns %edx,%eax
mov    %eax,%esi
sar    $0x3,%esi
and    $0xfffffff8,%eax
sub    %eax,%edx
lea    0xe3c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [42 x i8] c"Posao je zavrsen nakon %d dana i %d sati\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 4801
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = sdiv i32 %4, 120
br label %20
8: ; preds = %0
%9 = add nsw i32 %4, -4800
store i32 %9, i32* %1
%10 = icmp ult i32 %4, 7201
br i1 %10, label %11, label %16
11: ; preds = %8
%12 = trunc i32 %9 to i16
%13 = udiv i16 %12, 75
%14 = add nuw nsw i16 %13, 40
%15 = zext i16 %14 to i32
br label %20
16: ; preds = %8
%17 = add nsw i32 %4, -7200
store i32 %17, i32* %1
%18 = udiv i32 %17, 159
%19 = add nuw nsw i32 %18, 72
br label %20
20: ; preds = %11, %16, %6
%21 = phi i32 [ %7, %6 ], [ %15, %11 ], [ %19, %16 ]
%22 = sdiv i32 %21, 8
%23 = mul nsw i32 %22, -8
%24 = add nsw i32 %23, %21
%25 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i32 %22, i32 %24)
ret i32 0
}