#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*/ getid(int *);
int /*<<< orphan*/ printid(int);
int find(int val) {
  int a[11];
  getid(a);
  int i, s = 0;
  for (i = 1; i <= 9; i += 2) {
    if (a[i] == val) {
      printid(i);
      break;
      s = 1;
    }
  }
}


x86 assembly (clang, -O0):
<find>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <getid@plt>
movl   $0x0,-0x48(%rbp)
movl   $0x1,-0x44(%rbp)
cmpl   $0x9,-0x44(%rbp)
jg     117d <find+0x5d>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
cmp    -0x8(%rbp),%eax
jne    116a <find+0x4a>
mov    -0x44(%rbp),%edi
call   1040 <printid@plt>
jmp    117d <find+0x5d>
jmp    116f <find+0x4f>
mov    -0x44(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x44(%rbp)
jmp    1142 <find+0x22>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find>:
push   %rbx
sub    $0x30,%rsp
mov    %edi,%ebx
mov    %rsp,%rdi
call   1030 <getid@plt>
mov    $0x1,%edi
cmp    %ebx,0x4(%rsp)
je     1166 <find+0x46>
mov    $0x3,%edi
cmp    %ebx,0xc(%rsp)
je     1166 <find+0x46>
mov    $0x5,%edi
cmp    %ebx,0x14(%rsp)
je     1166 <find+0x46>
mov    $0x7,%edi
cmp    %ebx,0x1c(%rsp)
je     1166 <find+0x46>
mov    $0x9,%edi
cmp    %ebx,0x24(%rsp)
jne    116b <find+0x4b>
call   1040 <printid@plt>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @find(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [11 x i32]
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
%7 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 0
%8 = call i32 @getid(i32* %7)
store i32 0, i32* %6
store i32 1, i32* %5
br label %9
9: ; preds = %23, %1
%10 = load i32, i32* %5
%11 = icmp sle i32 %10, 9
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [11 x i32], [11 x i32]* %4, i64 0, i64 %14
%16 = load i32, i32* %15
%17 = load i32, i32* %3
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %22
19: ; preds = %12
%20 = load i32, i32* %5
%21 = call i32 @printid(i32 %20)
br label %26
22: ; preds = %12
br label %23
23: ; preds = %22
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 2
store i32 %25, i32* %5
br label %9
26: ; preds = %19, %9
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @find(i32 %0) {
%2 = alloca [11 x i32]
%3 = bitcast [11 x i32]* %2 to i8*
%4 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 0
%5 = call i32 @getid(i32* %4)
%6 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 1
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, %0
br i1 %8, label %9, label %12
9: ; preds = %24, %20, %16, %12, %1
%10 = phi i32 [ 1, %1 ], [ 3, %12 ], [ 5, %16 ], [ 7, %20 ], [ 9, %24 ]
%11 = call i32 @printid(i32 %10)
br label %28
12: ; preds = %1
%13 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 3
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, %0
br i1 %15, label %9, label %16
16: ; preds = %12
%17 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 5
%18 = load i32, i32* %17
%19 = icmp eq i32 %18, %0
br i1 %19, label %9, label %20
20: ; preds = %16
%21 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 7
%22 = load i32, i32* %21
%23 = icmp eq i32 %22, %0
br i1 %23, label %9, label %24
24: ; preds = %20
%25 = getelementptr inbounds [11 x i32], [11 x i32]* %2, i64 0, i64 9
%26 = load i32, i32* %25
%27 = icmp eq i32 %26, %0
br i1 %27, label %9, label %28
28: ; preds = %24, %9
ret i32 undef
}