#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);
int sequential_search(int *, int, int);
char *test_successful_search_op() {
  int array[] = {56, 43, 145, -67, -90, 0};
  do {
    if (!(sequential_search(array, 6, 0) == 6)) {
      printf("Line number is: %d\n", 37);
      return "error, search was not successful";
    }
  } while (0);
  do {
    if (!(sequential_search(array, 6, 43) == 2)) {
      printf("Line number is: %d\n", 38);
      return "error, search was not successful";
    }
  } while (0);
  do {
    if (!(sequential_search(array, 6, -67) == 4)) {
      printf("Line number is: %d\n", 39);
      return "error, search was not successful";
    }
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<test_successful_search_op>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
xor    %edx,%edx
call   1040 <sequential_search@plt>
cmp    $0x6,%eax
je     1183 <test_successful_search_op+0x63>
lea    0xeaf(%rip),%rdi
mov    $0x25,%esi
call   1030 <printf@plt>
lea    0xeb2(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121e <test_successful_search_op+0xfe>
jmp    1188 <test_successful_search_op+0x68>
jmp    118d <test_successful_search_op+0x6d>
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
mov    $0x2b,%edx
call   1040 <sequential_search@plt>
cmp    $0x2,%eax
je     11ca <test_successful_search_op+0xaa>
lea    0xe68(%rip),%rdi
mov    $0x26,%esi
call   1030 <printf@plt>
lea    0xe6b(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121e <test_successful_search_op+0xfe>
jmp    11cf <test_successful_search_op+0xaf>
jmp    11d4 <test_successful_search_op+0xb4>
lea    -0x20(%rbp),%rdi
mov    $0x6,%esi
mov    $0xffffffbd,%edx
call   1040 <sequential_search@plt>
cmp    $0x4,%eax
je     1211 <test_successful_search_op+0xf1>
lea    0xe21(%rip),%rdi
mov    $0x27,%esi
call   1030 <printf@plt>
lea    0xe24(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    121e <test_successful_search_op+0xfe>
jmp    1216 <test_successful_search_op+0xf6>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_successful_search_op>:
sub    $0x18,%rsp
mov    0xee5(%rip),%rax
mov    %rax,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x6,%esi
xor    %edx,%edx
call   1040 <sequential_search@plt>
mov    $0x25,%esi
cmp    $0x6,%eax
jne    1193 <test_successful_search_op+0x73>
mov    %rsp,%rdi
mov    $0x6,%esi
mov    $0x2b,%edx
call   1040 <sequential_search@plt>
mov    $0x26,%esi
cmp    $0x2,%eax
jne    1193 <test_successful_search_op+0x73>
mov    %rsp,%rdi
mov    $0x6,%esi
mov    $0xffffffbd,%edx
call   1040 <sequential_search@plt>
mov    $0x27,%esi
cmp    $0x4,%eax
jne    1193 <test_successful_search_op+0x73>
xor    %eax,%eax
add    $0x18,%rsp
ret
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
lea    0xe86(%rip),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.test_successful_search_op.array = [6 x i32] [i32 56, i32 43, i32 145, i32 -67, i32 -90, i32 0]
@.str = [20 x i8] c"Line number is: %d\0A\00"
@.str.1 = [33 x i8] c"error, search was not successful\00"
define i8* @test_successful_search_op() {
%1 = alloca i8*
%2 = alloca [6 x i32]
%3 = bitcast [6 x i32]* %2 to i8*
br label %4
4: ; preds = %0
%5 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%6 = call i32 @sequential_search(i32* %5, i32 6, i32 0)
%7 = icmp eq i32 %6, 6
br i1 %7, label %10, label %8
8: ; preds = %4
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 37)
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %28
10: ; preds = %4
br label %11
11: ; preds = %10
br label %12
12: ; preds = %11
%13 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%14 = call i32 @sequential_search(i32* %13, i32 6, i32 43)
%15 = icmp eq i32 %14, 2
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 38)
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %28
18: ; preds = %12
br label %19
19: ; preds = %18
br label %20
20: ; preds = %19
%21 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%22 = call i32 @sequential_search(i32* %21, i32 6, i32 -67)
%23 = icmp eq i32 %22, 4
br i1 %23, label %26, label %24
24: ; preds = %20
%25 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 39)
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8** %1
br label %28
26: ; preds = %20
br label %27
27: ; preds = %26
store i8* null, i8** %1
br label %28
28: ; preds = %27, %24, %16, %8
%29 = load i8*, i8** %1
ret i8* %29
}

LLVM IR (-O2):
@__const.test_successful_search_op.array = [6 x i32] [i32 56, i32 43, i32 145, i32 -67, i32 -90, i32 0]
@.str = [20 x i8] c"Line number is: %d\0A\00"
@.str.1 = [33 x i8] c"error, search was not successful\00"
define i8* @test_successful_search_op() {
%1 = alloca [6 x i32]
%2 = bitcast [6 x i32]* %1 to i8*
%3 = getelementptr inbounds [6 x i32], [6 x i32]* %1, i64 0, i64 0
%4 = call i32 @sequential_search(i32* %3, i32 6, i32 0)
%5 = icmp eq i32 %4, 6
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = call i32 @sequential_search(i32* %3, i32 6, i32 43)
%8 = icmp eq i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = call i32 @sequential_search(i32* %3, i32 6, i32 -67)
%11 = icmp eq i32 %10, 4
br i1 %11, label %15, label %12
12: ; preds = %9, %6, %0
%13 = phi i32 [ 37, %0 ], [ 38, %6 ], [ 39, %9 ]
%14 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %9
%16 = phi i8* [ null, %9 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), %12 ]
ret i8* %16
}