#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 /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int sati, minuti;
  double vreme, put;
  printf("Sati, minuti? ");
  scanf("%d %d", &sati, &minuti);
  vreme = (double)sati + (minuti / 60.0);
  put = 0;
  if (vreme > 0) {
    if (vreme >= 2)
      put += 2 * 120;
    else
      put += vreme * 120;
    vreme -= 2;
    if (vreme > 0) {
      if (vreme >= 2.5)
        put += 2.5 * 90;
      else
        put += vreme * 90;
      vreme -= 2.5;
      if (vreme > 0) {
        vreme -= 0.5;
        if (vreme > 0) {
          put += vreme * 75;
        }
      }
    }
  }
  printf("Predjeni put je: %lfkm", put);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf13(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe9d(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12ca <main+0x1aa>
movsd  -0x18(%rbp),%xmm0
movsd  0xe71(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11b8 <main+0x98>
movsd  0xe6f(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11d7 <main+0xb7>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe46(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe24(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12c5 <main+0x1a5>
movsd  -0x18(%rbp),%xmm0
movsd  0xe14(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     122d <main+0x10d>
movsd  0xe12(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    124c <main+0x12c>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xde9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xdc7(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12c0 <main+0x1a0>
movsd  -0x18(%rbp),%xmm0
movsd  0xdb7(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    12bb <main+0x19b>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xd92(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    12c0 <main+0x1a0>
jmp    12c5 <main+0x1a5>
jmp    12ca <main+0x1aa>
movsd  -0x20(%rbp),%xmm0
lea    0xd87(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf30(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf31(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cvtsi2sdl 0x4(%rsp),%xmm0
cvtsi2sdl (%rsp),%xmm1
divsd  0xeaa(%rip),%xmm1
addsd  %xmm0,%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jbe    120c <main+0xec>
movsd  0xe98(%rip),%xmm3
mulsd  %xmm1,%xmm3
xorpd  %xmm2,%xmm2
addsd  %xmm2,%xmm3
movsd  0xe8c(%rip),%xmm0
cmpnlesd %xmm1,%xmm0
andpd  %xmm0,%xmm3
movsd  0xe83(%rip),%xmm4
andnpd %xmm4,%xmm0
orpd   %xmm3,%xmm0
addsd  0xe7b(%rip),%xmm1
ucomisd %xmm2,%xmm1
jbe    120c <main+0xec>
movsd  0xe75(%rip),%xmm3
addsd  %xmm0,%xmm3
movsd  0xe71(%rip),%xmm4
mulsd  %xmm1,%xmm4
addsd  %xmm0,%xmm4
movsd  0xe69(%rip),%xmm0
cmpnlesd %xmm1,%xmm0
andpd  %xmm0,%xmm4
andnpd %xmm3,%xmm0
orpd   %xmm4,%xmm0
addsd  0xe58(%rip),%xmm1
ucomisd %xmm2,%xmm1
jbe    120c <main+0xec>
addsd  0xe52(%rip),%xmm1
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm1
jbe    120c <main+0xec>
mulsd  0xe48(%rip),%xmm1
addsd  %xmm1,%xmm0
lea    0xe5a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Sati, minuti? \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [23 x i8] c"Predjeni put je: %lfkm\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = sitofp i32 %8 to double
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 6.000000e+01
%13 = fadd double %9, %12
store double %13, double* %4
store double 0.000000e+00, double* %5
%14 = load double, double* %4
%15 = fcmp ogt double %14, 0.000000e+00
br i1 %15, label %16, label %58
16: ; preds = %0
%17 = load double, double* %4
%18 = fcmp oge double %17, 2.000000e+00
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load double, double* %5
%21 = fadd double %20, 2.400000e+02
store double %21, double* %5
br label %26
22: ; preds = %16
%23 = load double, double* %4
%24 = load double, double* %5
%25 = call double @llvm.fmuladd.f64(double %23, double 1.200000e+02, double %24)
store double %25, double* %5
br label %26
26: ; preds = %22, %19
%27 = load double, double* %4
%28 = fsub double %27, 2.000000e+00
store double %28, double* %4
%29 = load double, double* %4
%30 = fcmp ogt double %29, 0.000000e+00
br i1 %30, label %31, label %57
31: ; preds = %26
%32 = load double, double* %4
%33 = fcmp oge double %32, 2.500000e+00
br i1 %33, label %34, label %37
34: ; preds = %31
%35 = load double, double* %5
%36 = fadd double %35, 2.250000e+02
store double %36, double* %5
br label %41
37: ; preds = %31
%38 = load double, double* %4
%39 = load double, double* %5
%40 = call double @llvm.fmuladd.f64(double %38, double 9.000000e+01, double %39)
store double %40, double* %5
br label %41
41: ; preds = %37, %34
%42 = load double, double* %4
%43 = fsub double %42, 2.500000e+00
store double %43, double* %4
%44 = load double, double* %4
%45 = fcmp ogt double %44, 0.000000e+00
br i1 %45, label %46, label %56
46: ; preds = %41
%47 = load double, double* %4
%48 = fsub double %47, 5.000000e-01
store double %48, double* %4
%49 = load double, double* %4
%50 = fcmp ogt double %49, 0.000000e+00
br i1 %50, label %51, label %55
51: ; preds = %46
%52 = load double, double* %4
%53 = load double, double* %5
%54 = call double @llvm.fmuladd.f64(double %52, double 7.500000e+01, double %53)
store double %54, double* %5
br label %55
55: ; preds = %51, %46
br label %56
56: ; preds = %55, %41
br label %57
57: ; preds = %56, %26
br label %58
58: ; preds = %57, %0
%59 = load double, double* %5
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %59)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Sati, minuti? \00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [23 x i8] c"Predjeni put je: %lfkm\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = sitofp i32 %7 to double
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 6.000000e+01
%12 = fadd double %11, %8
%13 = fcmp ogt double %12, 0.000000e+00
br i1 %13, label %14, label %32
14: ; preds = %0
%15 = fcmp ult double %12, 2.000000e+00
%16 = call double @llvm.fmuladd.f64(double %12, double 1.200000e+02, double 0.000000e+00)
%17 = select i1 %15, double %16, double 2.400000e+02
%18 = fadd double %12, -2.000000e+00
%19 = fcmp ogt double %18, 0.000000e+00
br i1 %19, label %20, label %32
20: ; preds = %14
%21 = fcmp ult double %18, 2.500000e+00
%22 = fadd double %17, 2.250000e+02
%23 = call double @llvm.fmuladd.f64(double %18, double 9.000000e+01, double %17)
%24 = select i1 %21, double %23, double %22
%25 = fadd double %18, -2.500000e+00
%26 = fcmp ogt double %25, 0.000000e+00
br i1 %26, label %27, label %32
27: ; preds = %20
%28 = fadd double %25, -5.000000e-01
%29 = fcmp ogt double %28, 0.000000e+00
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call double @llvm.fmuladd.f64(double %28, double 7.500000e+01, double %24)
br label %32
32: ; preds = %14, %27, %30, %20, %0
%33 = phi double [ %31, %30 ], [ %24, %27 ], [ %24, %20 ], [ %17, %14 ], [ 0.000000e+00, %0 ]
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %33)
ret i32 0
}