#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*/ partition(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int Bronze() {
  int arr[10], i, temp[10];
  for (i = 0; i < 10; i++) {
    scanf("%d", &arr[i]);
    temp[i] = arr[i];
  }
  partition(temp, 0, 9);
  for (i = 0; i < 10; i++) {
    if (arr[i] == temp[2]) {
      printf("%d", i + 1);
      return 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<Bronze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    1182 <Bronze+0x52>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea1(%rip),%rdi
call   1050 <scanf@plt>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
movslq -0x34(%rbp),%rax
mov    %ecx,-0x60(%rbp,%rax,4)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    113f <Bronze+0xf>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1030 <partition@plt>
movl   $0x0,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jge    11e5 <Bronze+0xb5>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
cmp    -0x58(%rbp),%eax
jne    11d2 <Bronze+0xa2>
mov    -0x34(%rbp),%esi
add    $0x1,%esi
lea    0xe3f(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11ec <Bronze+0xbc>
jmp    11d7 <Bronze+0xa7>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1199 <Bronze+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bronze>:
push   %rbx
sub    $0x60,%rsp
lea    0xec4(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    (%rsp),%eax
mov    %eax,0x30(%rsp)
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,0x34(%rsp)
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
mov    %eax,0x38(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
mov    %eax,0x3c(%rsp)
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x10(%rsp),%eax
mov    %eax,0x40(%rsp)
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x14(%rsp),%eax
mov    %eax,0x44(%rsp)
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x18(%rsp),%eax
mov    %eax,0x48(%rsp)
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x1c(%rsp),%eax
mov    %eax,0x4c(%rsp)
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x20(%rsp),%eax
mov    %eax,0x50(%rsp)
lea    0x24(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
mov    0x24(%rsp),%eax
mov    %eax,0x54(%rsp)
lea    0x30(%rsp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
call   1030 <partition@plt>
mov    0x38(%rsp),%eax
mov    $0x1,%esi
cmp    %eax,(%rsp)
je     128d <Bronze+0x15d>
mov    $0x2,%esi
cmp    %eax,0x4(%rsp)
je     128d <Bronze+0x15d>
mov    $0x3,%esi
cmp    %eax,0x8(%rsp)
je     128d <Bronze+0x15d>
mov    $0x4,%esi
cmp    %eax,0xc(%rsp)
je     128d <Bronze+0x15d>
mov    $0x5,%esi
cmp    %eax,0x10(%rsp)
je     128d <Bronze+0x15d>
mov    $0x6,%esi
cmp    %eax,0x14(%rsp)
je     128d <Bronze+0x15d>
mov    $0x7,%esi
cmp    %eax,0x18(%rsp)
je     128d <Bronze+0x15d>
mov    $0x8,%esi
cmp    %eax,0x1c(%rsp)
je     128d <Bronze+0x15d>
mov    $0x9,%esi
cmp    %eax,0x20(%rsp)
je     128d <Bronze+0x15d>
mov    $0xa,%esi
cmp    %eax,0x24(%rsp)
jne    1299 <Bronze+0x169>
lea    0xd6c(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @Bronze() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca [10 x i32]
store i32 0, i32* %3
br label %5
5: ; preds = %20, %0
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %23
8: ; preds = %5
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %10
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %11)
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 %18
store i32 %16, i32* %19
br label %20
20: ; preds = %8
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %5
23: ; preds = %5
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 0
%25 = call i32 @partition(i32* %24, i32 0, i32 9)
store i32 0, i32* %3
br label %26
26: ; preds = %42, %23
%27 = load i32, i32* %3
%28 = icmp slt i32 %27, 10
br i1 %28, label %29, label %45
29: ; preds = %26
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %31
%33 = load i32, i32* %32
%34 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 2
%35 = load i32, i32* %34
%36 = icmp eq i32 %33, %35
br i1 %36, label %37, label %41
37: ; preds = %29
%38 = load i32, i32* %3
%39 = add nsw i32 %38, 1
%40 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %39)
store i32 0, i32* %1
br label %46
41: ; preds = %29
br label %42
42: ; preds = %41
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
store i32 %44, i32* %3
br label %26
45: ; preds = %26
store i32 0, i32* %1
br label %46
46: ; preds = %45, %37
%47 = load i32, i32* %1
ret i32 %47
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @Bronze() {
%1 = alloca [10 x i32]
%2 = alloca [10 x i32]
%3 = bitcast [10 x i32]* %1 to i8*
%4 = bitcast [10 x i32]* %2 to i8*
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %5)
%7 = load i32, i32* %5
%8 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
store i32 %7, i32* %8
%9 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 1
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %9)
%11 = load i32, i32* %9
%12 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 1
store i32 %11, i32* %12
%13 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 2
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %13)
%15 = load i32, i32* %13
%16 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 2
store i32 %15, i32* %16
%17 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 3
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %17)
%19 = load i32, i32* %17
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 3
store i32 %19, i32* %20
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 4
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %21)
%23 = load i32, i32* %21
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 4
store i32 %23, i32* %24
%25 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %25)
%27 = load i32, i32* %25
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 5
store i32 %27, i32* %28
%29 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 6
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %29)
%31 = load i32, i32* %29
%32 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 6
store i32 %31, i32* %32
%33 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 7
%34 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %33)
%35 = load i32, i32* %33
%36 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 7
store i32 %35, i32* %36
%37 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 8
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %37)
%39 = load i32, i32* %37
%40 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 8
store i32 %39, i32* %40
%41 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 9
%42 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %41)
%43 = load i32, i32* %41
%44 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 9
store i32 %43, i32* %44
%45 = call i32 @partition(i32* %8, i32 0, i32 9)
%46 = load i32, i32* %16
%47 = load i32, i32* %5
%48 = icmp eq i32 %47, %46
br i1 %48, label %49, label %52
49: ; preds = %76, %73, %70, %67, %64, %61, %58, %55, %52, %0
%50 = phi i32 [ 1, %0 ], [ 2, %52 ], [ 3, %55 ], [ 4, %58 ], [ 5, %61 ], [ 6, %64 ], [ 7, %67 ], [ 8, %70 ], [ 9, %73 ], [ 10, %76 ]
%51 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %50)
br label %79
52: ; preds = %0
%53 = load i32, i32* %9
%54 = icmp eq i32 %53, %46
br i1 %54, label %49, label %55
55: ; preds = %52
%56 = load i32, i32* %13
%57 = icmp eq i32 %56, %46
br i1 %57, label %49, label %58
58: ; preds = %55
%59 = load i32, i32* %17
%60 = icmp eq i32 %59, %46
br i1 %60, label %49, label %61
61: ; preds = %58
%62 = load i32, i32* %21
%63 = icmp eq i32 %62, %46
br i1 %63, label %49, label %64
64: ; preds = %61
%65 = load i32, i32* %25
%66 = icmp eq i32 %65, %46
br i1 %66, label %49, label %67
67: ; preds = %64
%68 = load i32, i32* %29
%69 = icmp eq i32 %68, %46
br i1 %69, label %49, label %70
70: ; preds = %67
%71 = load i32, i32* %33
%72 = icmp eq i32 %71, %46
br i1 %72, label %49, label %73
73: ; preds = %70
%74 = load i32, i32* %37
%75 = icmp eq i32 %74, %46
br i1 %75, label %49, label %76
76: ; preds = %73
%77 = load i32, i32* %41
%78 = icmp eq i32 %77, %46
br i1 %78, label %49, label %79
79: ; preds = %76, %49
ret i32 0
}