#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 main() {
  int arac_1 = 40;
  int arac_2 = 85;
  int mesafe = 450;
  int aracbir_konum = 120;
  int araciki_konum = 0;
  int saat = 1;
  int bir_varis, iki_varis;
  printf("saat \t\t 1.arac \t 2.arac\n");
  do {
    printf("%d", saat);
    printf("\t\t %d", aracbir_konum);
    printf("\t\t %d\n", araciki_konum);
    saat++;
    aracbir_konum += arac_1;
    araciki_konum += arac_2;
    if (aracbir_konum >= mesafe) {
      bir_varis = saat + 3;
    }
    if (araciki_konum >= mesafe) {
      iki_varis = saat;
    }
  } while (mesafe > aracbir_konum || mesafe > araciki_konum);
  printf("Birinci arac B sehrine %d. saatte vardi.\n", bir_varis);
  printf("Ikinci arac B sehrine %d. saatte vardi.\n", iki_varis);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x28,-0x8(%rbp)
movl   $0x55,-0xc(%rbp)
movl   $0x1c2,-0x10(%rbp)
movl   $0x78,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x1c(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11ba <main+0xaa>
mov    -0x1c(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jl     11cc <main+0xbc>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x24(%rbp)
jmp    11d1 <main+0xc1>
mov    -0x10(%rbp),%ecx
mov    $0x1,%al
cmp    -0x14(%rbp),%ecx
mov    %al,-0x25(%rbp)
jg     11ee <main+0xde>
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
setg   %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
test   $0x1,%al
jne    1157 <main+0x47>
mov    -0x20(%rbp),%esi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%esi
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xf2e(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebx
mov    $0x78,%eax
lea    0xebe(%rip),%r13
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %ecx,%r15d
mov    %eax,%r12d
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe93(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x28(%r12),%eax
lea    0x4(%rbx),%edx
add    $0x1,%ebx
cmp    $0x16d,%r15d
cmovae %ebx,%r14d
lea    0x55(%r15),%ecx
cmp    $0x19a,%r12d
cmovae %edx,%ebp
jb     1150 <main+0x30>
cmp    $0x16d,%r15d
jb     1150 <main+0x30>
lea    0xe53(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe6d(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"saat \09\09 1.arac \09 2.arac\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"\09\09 %d\00"
@.str.3 = [7 x i8] c"\09\09 %d\0A\00"
@.str.4 = [42 x i8] c"Birinci arac B sehrine %d. saatte vardi.\0A\00"
@.str.5 = [41 x i8] c"Ikinci arac B sehrine %d. saatte vardi.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 40, i32* %2
store i32 85, i32* %3
store i32 450, i32* %4
store i32 120, i32* %5
store i32 0, i32* %6
store i32 1, i32* %7
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %47, %0
%12 = load i32, i32* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %5
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = load i32, i32* %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %16)
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
store i32 %19, i32* %7
%20 = load i32, i32* %2
%21 = load i32, i32* %5
%22 = add nsw i32 %21, %20
store i32 %22, i32* %5
%23 = load i32, i32* %3
%24 = load i32, i32* %6
%25 = add nsw i32 %24, %23
store i32 %25, i32* %6
%26 = load i32, i32* %5
%27 = load i32, i32* %4
%28 = icmp sge i32 %26, %27
br i1 %28, label %29, label %32
29: ; preds = %11
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 3
store i32 %31, i32* %8
br label %32
32: ; preds = %29, %11
%33 = load i32, i32* %6
%34 = load i32, i32* %4
%35 = icmp sge i32 %33, %34
br i1 %35, label %36, label %38
36: ; preds = %32
%37 = load i32, i32* %7
store i32 %37, i32* %9
br label %38
38: ; preds = %36, %32
br label %39
39: ; preds = %38
%40 = load i32, i32* %4
%41 = load i32, i32* %5
%42 = icmp sgt i32 %40, %41
br i1 %42, label %47, label %43
43: ; preds = %39
%44 = load i32, i32* %4
%45 = load i32, i32* %6
%46 = icmp sgt i32 %44, %45
br label %47
47: ; preds = %43, %39
%48 = phi i1 [ true, %39 ], [ %46, %43 ]
br i1 %48, label %11, label %49
49: ; preds = %47
%50 = load i32, i32* %8
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i32 %50)
%52 = load i32, i32* %9
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %52)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [6 x i8] c"\09\09 %d\00"
@.str.3 = [7 x i8] c"\09\09 %d\0A\00"
@.str.4 = [42 x i8] c"Birinci arac B sehrine %d. saatte vardi.\0A\00"
@.str.5 = [41 x i8] c"Ikinci arac B sehrine %d. saatte vardi.\0A\00"
@str = [24 x i8] c"saat \09\09 1.arac \09 2.arac\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = phi i32 [ 120, %0 ], [ %12, %2 ]
%4 = phi i32 [ 0, %0 ], [ %13, %2 ]
%5 = phi i32 [ 1, %0 ], [ %11, %2 ]
%6 = phi i32 [ undef, %0 ], [ %16, %2 ]
%7 = phi i32 [ undef, %0 ], [ %18, %2 ]
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %4)
%11 = add nuw nsw i32 %5, 1
%12 = add nuw nsw i32 %3, 40
%13 = add nuw nsw i32 %4, 85
%14 = icmp ugt i32 %3, 409
%15 = add nuw nsw i32 %5, 4
%16 = select i1 %14, i32 %15, i32 %6
%17 = icmp ugt i32 %4, 364
%18 = select i1 %17, i32 %11, i32 %7
%19 = icmp ult i32 %3, 410
%20 = icmp ult i32 %4, 365
%21 = select i1 %19, i1 true, i1 %20
br i1 %21, label %2, label %22
22: ; preds = %2
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %18)
ret i32 0
}