#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 saat_farki(int, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  printf("Programdan cikmak icin -1 giriniz.\n");
  int sonsuz_dongu = 0;
  while (sonsuz_dongu < 1) {
    int saat;
    printf("Saati giriniz: ");
    scanf("%d", &saat);
    if (saat == -1) {
      printf("Programdan cikilmistir :)");
      break;
    }
    int dakika;
    printf("Dakikayi giriniz: ");
    scanf("%d", &dakika);
    if (dakika == -1) {
      printf("Programdan cikilmistir :)");
      break;
    }
    int saniye;
    printf("Saniyeyi giriniz: ");
    scanf("%d", &saniye);
    if (saniye == -1) {
      printf("Programdan cikilmistir :)");
      break;
    }
    if ((saat > 24) || (dakika > 60) || (saniye > 60)) {
      printf("Saat,dakika veya saniyeden birini yanlis girdiniz!!\n");
    } else if ((saat < -1) || (dakika < -1) || (saniye < -1)) {
      printf("Saat,dakika veya saniyeden birini yanlis girdiniz!!\n");
    } else {
      saat = saat % 12;
      int gecen_saniye;
      gecen_saniye = saat_farki(saat, dakika, saniye);
      printf("Saat 12 den bu yana %d kadar saniye gecmistir.\n", gecen_saniye);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    12ab <main+0x17b>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0xc(%rbp)
jne    1199 <main+0x69>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ab <main+0x17b>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe86(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0x10(%rbp)
jne    11d4 <main+0xa4>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ab <main+0x17b>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4b(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0x14(%rbp)
jne    120f <main+0xdf>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12ab <main+0x17b>
cmpl   $0x18,-0xc(%rbp)
jg     122d <main+0xfd>
cmpl   $0x3c,-0x10(%rbp)
jg     122d <main+0xfd>
cmpl   $0x3c,-0x14(%rbp)
jle    1240 <main+0x110>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a6 <main+0x176>
cmpl   $0xffffffff,-0xc(%rbp)
jl     125e <main+0x12e>
cmpl   $0xffffffff,-0x10(%rbp)
jl     125e <main+0x12e>
cmpl   $0xffffffff,-0x14(%rbp)
jge    1271 <main+0x141>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a1 <main+0x171>
mov    -0xc(%rbp),%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1050 <saat_farki@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a6 <main+0x176>
jmp    1154 <main+0x24>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xf2e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0xffffffff,0xc(%rsp)
je     1296 <main+0x156>
lea    0xea2(%rip),%r14
lea    0xe7e(%rip),%rbx
lea    0x10(%rsp),%r15
lea    0xea2(%rip),%r12
lea    0x14(%rsp),%r13
lea    0xc(%rsp),%rbp
jmp    11e0 <main+0xa0>
nopw   0x0(%rax,%rax,1)
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xe3d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
cmpl   $0xffffffff,0xc(%rsp)
je     1296 <main+0x156>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
cmpl   $0xffffffff,0x10(%rsp)
je     1296 <main+0x156>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
mov    0x14(%rsp),%edx
cmp    $0xffffffff,%edx
je     1296 <main+0x156>
mov    0xc(%rsp),%eax
cmp    $0x18,%eax
jg     11b0 <main+0x70>
mov    0x10(%rsp),%esi
cmp    $0x3c,%esi
jg     11b0 <main+0x70>
cmp    $0x3d,%edx
jge    11b0 <main+0x70>
cmp    $0xffffffff,%eax
jl     11b0 <main+0x70>
cmp    $0xffffffff,%esi
jl     11b0 <main+0x70>
cmp    $0xfffffffe,%edx
jle    11b0 <main+0x70>
movsbl %al,%ecx
imul   $0x2b,%ecx,%ecx
movzwl %cx,%ecx
movswl %cx,%edi
shr    $0xf,%ecx
shr    $0x9,%edi
add    %cl,%dil
movzbl %dil,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %cl,%al
movsbl %al,%edi
mov    %edi,0xc(%rsp)
call   1060 <saat_farki@plt>
lea    0xdcb(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11bc <main+0x7c>
lea    0xd76(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Programdan cikmak icin -1 giriniz.\0A\00"
@.str.1 = [16 x i8] c"Saati giriniz: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [26 x i8] c"Programdan cikilmistir :)\00"
@.str.4 = [19 x i8] c"Dakikayi giriniz: \00"
@.str.5 = [19 x i8] c"Saniyeyi giriniz: \00"
@.str.6 = [53 x i8] c"Saat,dakika veya saniyeden birini yanlis girdiniz!!\0A\00"
@.str.7 = [48 x i8] c"Saat 12 den bu yana %d kadar saniye gecmistir.\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
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %8
8: ; preds = %64, %0
%9 = load i32, i32* %2
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %65
11: ; preds = %8
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %65
18: ; preds = %11
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %65
25: ; preds = %18
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%28 = load i32, i32* %5
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %32
30: ; preds = %25
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %65
32: ; preds = %25
%33 = load i32, i32* %3
%34 = icmp sgt i32 %33, 24
br i1 %34, label %41, label %35
35: ; preds = %32
%36 = load i32, i32* %4
%37 = icmp sgt i32 %36, 60
br i1 %37, label %41, label %38
38: ; preds = %35
%39 = load i32, i32* %5
%40 = icmp sgt i32 %39, 60
br i1 %40, label %41, label %43
41: ; preds = %38, %35, %32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0))
br label %64
43: ; preds = %38
%44 = load i32, i32* %3
%45 = icmp slt i32 %44, -1
br i1 %45, label %52, label %46
46: ; preds = %43
%47 = load i32, i32* %4
%48 = icmp slt i32 %47, -1
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = load i32, i32* %5
%51 = icmp slt i32 %50, -1
br i1 %51, label %52, label %54
52: ; preds = %49, %46, %43
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.6, i64 0, i64 0))
br label %63
54: ; preds = %49
%55 = load i32, i32* %3
%56 = srem i32 %55, 12
store i32 %56, i32* %3
%57 = load i32, i32* %3
%58 = load i32, i32* %4
%59 = load i32, i32* %5
%60 = call i32 @saat_farki(i32 %57, i32 %58, i32 %59)
store i32 %60, i32* %6
%61 = load i32, i32* %6
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i32 %61)
br label %63
63: ; preds = %54, %52
br label %64
64: ; preds = %63, %41
br label %8
65: ; preds = %30, %23, %16, %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c"Saati giriniz: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [26 x i8] c"Programdan cikilmistir :)\00"
@.str.4 = [19 x i8] c"Dakikayi giriniz: \00"
@.str.5 = [19 x i8] c"Saniyeyi giriniz: \00"
@.str.7 = [48 x i8] c"Saat 12 den bu yana %d kadar saniye gecmistir.\0A\00"
@str = [35 x i8] c"Programdan cikmak icin -1 giriniz.\00"
@str.9 = [52 x i8] c"Saat,dakika veya saniyeden birini yanlis girdiniz!!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%5 = bitcast i32* %1 to i8*
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, -1
br i1 %9, label %13, label %10
10: ; preds = %0
%11 = bitcast i32* %2 to i8*
%12 = bitcast i32* %3 to i8*
br label %15
13: ; preds = %53, %0
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %58
15: ; preds = %10, %53
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%18 = load i32, i32* %2
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %58
22: ; preds = %15
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0))
%24 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%25 = load i32, i32* %3
%26 = icmp eq i32 %25, -1
br i1 %26, label %27, label %29
27: ; preds = %22
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %58
29: ; preds = %22
%30 = load i32, i32* %1
%31 = icmp sgt i32 %30, 24
%32 = load i32, i32* %2
%33 = icmp sgt i32 %32, 60
%34 = select i1 %31, i1 true, i1 %33
%35 = icmp sgt i32 %25, 60
%36 = select i1 %34, i1 true, i1 %35
br i1 %36, label %37, label %39
37: ; preds = %29
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.9, i64 0, i64 0))
br label %53
39: ; preds = %29
%40 = icmp slt i32 %30, -1
%41 = icmp slt i32 %32, -1
%42 = select i1 %40, i1 true, i1 %41
%43 = icmp slt i32 %25, -1
%44 = select i1 %42, i1 true, i1 %43
br i1 %44, label %45, label %47
45: ; preds = %39
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([52 x i8], [52 x i8]* @str.9, i64 0, i64 0))
br label %53
47: ; preds = %39
%48 = trunc i32 %30 to i8
%49 = srem i8 %48, 12
%50 = sext i8 %49 to i32
store i32 %50, i32* %1
%51 = call i32 @saat_farki(i32 %50, i32 %32, i32 %25)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0), i32 %51)
br label %53
53: ; preds = %45, %47, %37
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%55 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%56 = load i32, i32* %1
%57 = icmp eq i32 %56, -1
br i1 %57, label %13, label %15
58: ; preds = %27, %20, %13
ret i32 0
}