#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*/ arr_rand(int *);
int find_max(int *);
int /*<<< orphan*/ print_arr(int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int a[20], b[20], c[20];
  arr_rand(a);
  arr_rand(b);
  arr_rand(c);
  print_arr(a);
  print_arr(b);
  print_arr(c);
  int am = find_max(a);
  int bm = find_max(b);
  int cm = find_max(c);
  int arr_min;
  if (am <= bm && am <= cm)
    arr_min = am;
  else if (bm <= am && bm <= cm)
    arr_min = bm;
  else
    arr_min = cm;
  printf("%d\n", arr_min);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
call   1040 <arr_rand@plt>
lea    -0xb0(%rbp),%rdi
call   1040 <arr_rand@plt>
lea    -0x100(%rbp),%rdi
call   1040 <arr_rand@plt>
lea    -0x60(%rbp),%rdi
call   1030 <print_arr@plt>
lea    -0xb0(%rbp),%rdi
call   1030 <print_arr@plt>
lea    -0x100(%rbp),%rdi
call   1030 <print_arr@plt>
lea    -0x60(%rbp),%rdi
call   1060 <find_max@plt>
mov    %eax,-0x104(%rbp)
lea    -0xb0(%rbp),%rdi
call   1060 <find_max@plt>
mov    %eax,-0x108(%rbp)
lea    -0x100(%rbp),%rdi
call   1060 <find_max@plt>
mov    %eax,-0x10c(%rbp)
mov    -0x104(%rbp),%eax
cmp    -0x108(%rbp),%eax
jg     11fc <main+0xbc>
mov    -0x104(%rbp),%eax
cmp    -0x10c(%rbp),%eax
jg     11fc <main+0xbc>
mov    -0x104(%rbp),%eax
mov    %eax,-0x110(%rbp)
jmp    1242 <main+0x102>
mov    -0x108(%rbp),%eax
cmp    -0x104(%rbp),%eax
jg     1231 <main+0xf1>
mov    -0x108(%rbp),%eax
cmp    -0x10c(%rbp),%eax
jg     1231 <main+0xf1>
mov    -0x108(%rbp),%eax
mov    %eax,-0x110(%rbp)
jmp    123d <main+0xfd>
mov    -0x10c(%rbp),%eax
mov    %eax,-0x110(%rbp)
jmp    1242 <main+0x102>
mov    -0x110(%rbp),%esi
lea    0xdb1(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xf8,%rsp
lea    0xa0(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <arr_rand@plt>
lea    0x50(%rsp),%r14
mov    %r14,%rdi
call   1040 <arr_rand@plt>
mov    %rsp,%r15
mov    %r15,%rdi
call   1040 <arr_rand@plt>
mov    %rbx,%rdi
call   1030 <print_arr@plt>
mov    %r14,%rdi
call   1030 <print_arr@plt>
mov    %r15,%rdi
call   1030 <print_arr@plt>
mov    %rbx,%rdi
call   1060 <find_max@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1060 <find_max@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1060 <find_max@plt>
cmp    %eax,%ebp
mov    %ebp,%ecx
cmovg  %eax,%ecx
cmp    %ebx,%ebp
cmovg  %eax,%ecx
cmp    %eax,%ebx
mov    %ebx,%esi
cmovg  %ecx,%esi
cmp    %ebp,%ebx
cmovg  %ecx,%esi
lea    0xe38(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xf8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [20 x i32]
%2 = alloca [20 x i32]
%3 = alloca [20 x i32]
%4 = bitcast [20 x i32]* %1 to i8*
%5 = bitcast [20 x i32]* %2 to i8*
%6 = bitcast [20 x i32]* %3 to i8*
%7 = getelementptr inbounds [20 x i32], [20 x i32]* %1, i64 0, i64 0
%8 = call i32 @arr_rand(i32* %7)
%9 = getelementptr inbounds [20 x i32], [20 x i32]* %2, i64 0, i64 0
%10 = call i32 @arr_rand(i32* %9)
%11 = getelementptr inbounds [20 x i32], [20 x i32]* %3, i64 0, i64 0
%12 = call i32 @arr_rand(i32* %11)
%13 = call i32 @print_arr(i32* %7)
%14 = call i32 @print_arr(i32* %9)
%15 = call i32 @print_arr(i32* %11)
%16 = call i32 @find_max(i32* %7)
%17 = call i32 @find_max(i32* %9)
%18 = call i32 @find_max(i32* %11)
%19 = icmp sgt i32 %16, %17
%20 = icmp sgt i32 %16, %18
%21 = select i1 %19, i1 true, i1 %20
%22 = icmp sgt i32 %17, %16
%23 = icmp sgt i32 %17, %18
%24 = select i1 %22, i1 true, i1 %23
%25 = select i1 %24, i32 %18, i32 %17
%26 = select i1 %21, i32 %25, i32 %16
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %26)
ret i32 0
}