#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 /*<<< orphan*/ sirala(int, int);
int main() {
  printf("Programdan cikmak icin -1 giriniz.\n");
  int sonsuz_dongu = 0;
  int birinci_sayi, ikinci_sayi;
  while (sonsuz_dongu < 1) {
    printf("Birinci sayiyi giriniz: ");
    scanf("%d", &birinci_sayi);
    if (birinci_sayi == -1) {
      printf("Programdan ciktiniz :)");
      break;
    }
    printf("Ikinci sayiyi giriniz: ");
    scanf("%d", &ikinci_sayi);
    if (ikinci_sayi == -1) {
      printf("Programdan ciktiniz :)");
      break;
    }
    if (birinci_sayi <= 0 || ikinci_sayi <= 0) {
      printf("Pozitif tam sayi giriniz.\n");
    } else {
      sirala(birinci_sayi, ikinci_sayi);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    11ff <main+0xcf>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0xc(%rbp)
jne    1193 <main+0x63>
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
jmp    11ff <main+0xcf>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
lea    0xe97(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0xffffffff,-0x10(%rbp)
jne    11ca <main+0x9a>
lea    0xe80(%rip),%rdi
call   1030 <printf@plt>
jmp    11ff <main+0xcf>
cmpl   $0x0,-0xc(%rbp)
jle    11de <main+0xae>
cmpl   $0x0,-0x10(%rbp)
jg     11ef <main+0xbf>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    11fa <main+0xca>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1050 <sirala@plt>
jmp    1152 <main+0x22>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
cmpl   $0xffffffff,(%rsp)
je     11ef <main+0xaf>
lea    0xeb4(%rip),%r14
lea    0xe93(%rip),%rbx
lea    0x4(%rsp),%r15
lea    0xedc(%rip),%r12
lea    0xe67(%rip),%r13
mov    %rsp,%rbp
jmp    11c1 <main+0x81>
xchg   %ax,%ax
mov    %r12,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
cmpl   $0xffffffff,(%rsp)
je     11ef <main+0xaf>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
cmp    $0xffffffff,%esi
je     11ef <main+0xaf>
mov    (%rsp),%edi
test   %edi,%edi
jle    11a0 <main+0x60>
test   %esi,%esi
jle    11a0 <main+0x60>
call   1060 <sirala@plt>
jmp    11a8 <main+0x68>
lea    0xe26(%rip),%rdi
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 = [36 x i8] c"Programdan cikmak icin -1 giriniz.\0A\00"
@.str.1 = [25 x i8] c"Birinci sayiyi giriniz: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [23 x i8] c"Programdan ciktiniz :)\00"
@.str.4 = [24 x i8] c"Ikinci sayiyi giriniz: \00"
@.str.5 = [27 x i8] c"Pozitif tam sayi giriniz.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %6
6: ; preds = %35, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 1
br i1 %8, label %9, label %36
9: ; preds = %6
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %36
16: ; preds = %9
%17 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
br label %36
23: ; preds = %16
%24 = load i32, i32* %3
%25 = icmp sle i32 %24, 0
br i1 %25, label %29, label %26
26: ; preds = %23
%27 = load i32, i32* %4
%28 = icmp sle i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26, %23
%30 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %35
31: ; preds = %26
%32 = load i32, i32* %3
%33 = load i32, i32* %4
%34 = call i32 @sirala(i32 %32, i32 %33)
br label %35
35: ; preds = %31, %29
br label %6
36: ; preds = %21, %14, %6
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"Birinci sayiyi giriniz: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [23 x i8] c"Programdan ciktiniz :)\00"
@.str.4 = [24 x i8] c"Ikinci sayiyi giriniz: \00"
@str = [35 x i8] c"Programdan cikmak icin -1 giriniz.\00"
@str.6 = [26 x i8] c"Pozitif tam sayi giriniz.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 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 %29, label %10
10: ; preds = %0, %24
%11 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, -1
br i1 %14, label %29, label %15
15: ; preds = %10
%16 = load i32, i32* %1
%17 = icmp slt i32 %16, 1
%18 = icmp slt i32 %13, 1
%19 = select i1 %17, i1 true, i1 %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.6, i64 0, i64 0))
br label %24
22: ; preds = %15
%23 = call i32 @sirala(i32 %16, i32 %13)
br label %24
24: ; preds = %22, %20
%25 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%27 = load i32, i32* %1
%28 = icmp eq i32 %27, -1
br i1 %28, label %29, label %10
29: ; preds = %10, %24, %0
%30 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}