#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 *, ...);
scalar_t__ rakam_sayisi(int, int);
int sayi_oku();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int N, i;
  printf("kac sayi gireceksiniz:");
  scanf("%d", &N);
  int s = sayi_oku();
  int enk_2 = s;
  int enb_1 = s;
  for (i = 1; i < N; i++) {
    int s = sayi_oku();
    if (rakam_sayisi(s, 1) > rakam_sayisi(enb_1, 1))
      enb_1 = s;
    if (rakam_sayisi(s, 2) < rakam_sayisi(enk_2, 2))
      enk_2 = s;
  }
  printf("en fazla 1 olan: %d\n", enb_1);
  printf("en az 2 olan: %d\n", enk_2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <sayi_oku@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    121b <main+0xdb>
mov    $0x0,%al
call   1040 <sayi_oku@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1060 <rakam_sayisi@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%edi
mov    $0x1,%esi
call   1060 <rakam_sayisi@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
jle    11d4 <main+0x94>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x2,%esi
call   1060 <rakam_sayisi@plt>
mov    %rax,-0x30(%rbp)
mov    -0x14(%rbp),%edi
mov    $0x2,%esi
call   1060 <rakam_sayisi@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
cmp    %rcx,%rax
jge    1208 <main+0xc8>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    120d <main+0xcd>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118a <main+0x4a>
mov    -0x18(%rbp),%esi
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%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    0xeae(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
xor    %eax,%eax
call   1040 <sayi_oku@plt>
mov    %eax,%ebp
cmpl   $0x2,0x4(%rsp)
jl     11f6 <main+0xb6>
mov    $0x1,%ebx
mov    %ebp,%r14d
jmp    119f <main+0x5f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%ebx
mov    %r15d,%ebp
mov    %r13d,%r14d
cmp    0x4(%rsp),%ebx
jge    11fc <main+0xbc>
xor    %eax,%eax
call   1040 <sayi_oku@plt>
mov    %eax,%r13d
mov    %eax,%edi
mov    $0x1,%esi
call   1060 <rakam_sayisi@plt>
mov    %rax,%r12
mov    %ebp,%edi
mov    $0x1,%esi
call   1060 <rakam_sayisi@plt>
mov    %r13d,%r15d
cmp    %rax,%r12
jg     11cf <main+0x8f>
mov    %ebp,%r15d
mov    %r13d,%edi
mov    $0x2,%esi
call   1060 <rakam_sayisi@plt>
mov    %rax,%rbp
mov    %r14d,%edi
mov    $0x2,%esi
call   1060 <rakam_sayisi@plt>
cmp    %rax,%rbp
jl     1190 <main+0x50>
mov    %r14d,%r13d
jmp    1190 <main+0x50>
mov    %ebp,%r13d
mov    %ebp,%r15d
lea    0xe17(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe1b(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1030 <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 = [23 x i8] c"kac sayi gireceksiniz:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"en fazla 1 olan: %d\0A\00"
@.str.3 = [18 x i8] c"en az 2 olan: %d\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
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = call i32 (...) @sayi_oku()
store i32 %10, i32* %4
%11 = load i32, i32* %4
store i32 %11, i32* %5
%12 = load i32, i32* %4
store i32 %12, i32* %6
store i32 1, i32* %3
br label %13
13: ; preds = %35, %0
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %38
17: ; preds = %13
%18 = call i32 (...) @sayi_oku()
store i32 %18, i32* %7
%19 = load i32, i32* %7
%20 = call i64 @rakam_sayisi(i32 %19, i32 1)
%21 = load i32, i32* %6
%22 = call i64 @rakam_sayisi(i32 %21, i32 1)
%23 = icmp sgt i64 %20, %22
br i1 %23, label %24, label %26
24: ; preds = %17
%25 = load i32, i32* %7
store i32 %25, i32* %6
br label %26
26: ; preds = %24, %17
%27 = load i32, i32* %7
%28 = call i64 @rakam_sayisi(i32 %27, i32 2)
%29 = load i32, i32* %5
%30 = call i64 @rakam_sayisi(i32 %29, i32 2)
%31 = icmp slt i64 %28, %30
br i1 %31, label %32, label %34
32: ; preds = %26
%33 = load i32, i32* %7
store i32 %33, i32* %5
br label %34
34: ; preds = %32, %26
br label %35
35: ; preds = %34
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %13
38: ; preds = %13
%39 = load i32, i32* %6
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %5
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %1
ret i32 %43
}

LLVM IR (-O2):
@.str = [23 x i8] c"kac sayi gireceksiniz:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"en fazla 1 olan: %d\0A\00"
@.str.3 = [18 x i8] c"en az 2 olan: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 (...) @sayi_oku()
%6 = load i32, i32* %1
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %24
8: ; preds = %0, %8
%9 = phi i32 [ %21, %8 ], [ 1, %0 ]
%10 = phi i32 [ %16, %8 ], [ %5, %0 ]
%11 = phi i32 [ %20, %8 ], [ %5, %0 ]
%12 = call i32 (...) @sayi_oku()
%13 = call i64 @rakam_sayisi(i32 %12, i32 1)
%14 = call i64 @rakam_sayisi(i32 %10, i32 1)
%15 = icmp sgt i64 %13, %14
%16 = select i1 %15, i32 %12, i32 %10
%17 = call i64 @rakam_sayisi(i32 %12, i32 2)
%18 = call i64 @rakam_sayisi(i32 %11, i32 2)
%19 = icmp slt i64 %17, %18
%20 = select i1 %19, i32 %12, i32 %11
%21 = add nuw nsw i32 %9, 1
%22 = load i32, i32* %1
%23 = icmp slt i32 %21, %22
br i1 %23, label %8, label %24
24: ; preds = %8, %0
%25 = phi i32 [ %5, %0 ], [ %20, %8 ]
%26 = phi i32 [ %5, %0 ], [ %16, %8 ]
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %25)
ret i32 0
}