#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 max(int *);
int min(int *);
int next(char *);
int /*<<< orphan*/ printf(char *, ...);
char *whattype(char *);
int main() {
  char *str1 = "test_123";
  char *type1 = whattype(str1);
  char *str2 = "_123";
  char *type2 = whattype(str2);
  char *str3 = "12345";
  char *type3 = whattype(str3);
  printf("Type 1: %s \n", type1);
  printf("Type 2: %s \n", type2);
  printf("Type 3: %s \n", type3);
  printf("Next for str1: %c \n", next(str1));
  printf("Next for str2: %c \n", next(str2));
  printf("Next for str3: %c \n", next(str3));
  int arr1[5] = {5, 6, 7, 8, 9};
  int arr2[5] = {42, 57, 63, 90, 94};
  int m1 = min(arr1);
  int m2 = max(arr1);
  int m3 = min(arr2);
  int m4 = max(arr2);
  printf("Min arr1: %d \n", m1);
  printf("Max arr1: %d \n", m2);
  printf("Min arr2: %d \n", m3);
  printf("Max arr2: %d \n", m4);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <whattype@plt>
mov    %rax,-0x18(%rbp)
lea    0xe83(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1070 <whattype@plt>
mov    %rax,-0x28(%rbp)
lea    0xe70(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1070 <whattype@plt>
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x38(%rbp),%rsi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1060 <next@plt>
mov    %eax,%esi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1060 <next@plt>
mov    %eax,%esi
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1060 <next@plt>
mov    %eax,%esi
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0xe7e(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe7b(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe79(%rip),%eax
mov    %eax,-0x40(%rbp)
mov    0xe7f(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xe7c(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xe7a(%rip),%eax
mov    %eax,-0x60(%rbp)
lea    -0x50(%rbp),%rdi
call   1040 <min@plt>
mov    %eax,-0x74(%rbp)
lea    -0x50(%rbp),%rdi
call   1050 <max@plt>
mov    %eax,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
call   1040 <min@plt>
mov    %eax,-0x7c(%rbp)
lea    -0x70(%rbp),%rdi
call   1050 <max@plt>
mov    %eax,-0x80(%rbp)
mov    -0x74(%rbp),%esi
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x78(%rbp),%esi
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x7c(%rbp),%esi
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x80(%rbp),%esi
lea    0xdc9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xe9b(%rip),%r12
mov    %r12,%rdi
call   1070 <whattype@plt>
mov    %rax,%rbx
lea    0xe8d(%rip),%r15
mov    %r15,%rdi
call   1070 <whattype@plt>
mov    %rax,%r13
lea    0xe80(%rip),%r14
mov    %r14,%rdi
call   1070 <whattype@plt>
mov    %rax,%rbp
lea    0xe74(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe70(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe6c(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r12,%rdi
call   1060 <next@plt>
lea    0xe60(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
call   1060 <next@plt>
lea    0xe5c(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
call   1060 <next@plt>
lea    0xe58(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xeab(%rip),%eax
mov    %eax,0x30(%rsp)
movaps 0xe90(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
mov    0xeb5(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xe9a(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <min@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1050 <max@plt>
mov    %eax,%r14d
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <min@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1050 <max@plt>
mov    %eax,%ebx
lea    0xdff(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdfe(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdfc(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdfa(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"test_123\00"
@.str.1 = [5 x i8] c"_123\00"
@.str.2 = [6 x i8] c"12345\00"
@.str.3 = [13 x i8] c"Type 1: %s \0A\00"
@.str.4 = [13 x i8] c"Type 2: %s \0A\00"
@.str.5 = [13 x i8] c"Type 3: %s \0A\00"
@.str.6 = [20 x i8] c"Next for str1: %c \0A\00"
@.str.7 = [20 x i8] c"Next for str2: %c \0A\00"
@.str.8 = [20 x i8] c"Next for str3: %c \0A\00"
@__const.main.arr1 = [5 x i32] [i32 5, i32 6, i32 7, i32 8, i32 9]
@__const.main.arr2 = [5 x i32] [i32 42, i32 57, i32 63, i32 90, i32 94]
@.str.9 = [15 x i8] c"Min arr1: %d \0A\00"
@.str.10 = [15 x i8] c"Max arr1: %d \0A\00"
@.str.11 = [15 x i8] c"Min arr2: %d \0A\00"
@.str.12 = [15 x i8] c"Max arr2: %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca [5 x i32]
%9 = alloca [5 x i32]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %2
%14 = load i8*, i8** %2
%15 = call i8* @whattype(i8* %14)
store i8* %15, i8** %3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8** %4
%16 = load i8*, i8** %4
%17 = call i8* @whattype(i8* %16)
store i8* %17, i8** %5
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8** %6
%18 = load i8*, i8** %6
%19 = call i8* @whattype(i8* %18)
store i8* %19, i8** %7
%20 = load i8*, i8** %3
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %20)
%22 = load i8*, i8** %5
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %22)
%24 = load i8*, i8** %7
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %24)
%26 = load i8*, i8** %2
%27 = call i32 @next(i8* %26)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %27)
%29 = load i8*, i8** %4
%30 = call i32 @next(i8* %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 %30)
%32 = load i8*, i8** %6
%33 = call i32 @next(i8* %32)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 %33)
%35 = bitcast [5 x i32]* %8 to i8*
%36 = bitcast [5 x i32]* %9 to i8*
%37 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%38 = call i32 @min(i32* %37)
store i32 %38, i32* %10
%39 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%40 = call i32 @max(i32* %39)
store i32 %40, i32* %11
%41 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%42 = call i32 @min(i32* %41)
store i32 %42, i32* %12
%43 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%44 = call i32 @max(i32* %43)
store i32 %44, i32* %13
%45 = load i32, i32* %10
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %11
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 %47)
%49 = load i32, i32* %12
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 %49)
%51 = load i32, i32* %13
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 %51)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"test_123\00"
@.str.1 = [5 x i8] c"_123\00"
@.str.2 = [6 x i8] c"12345\00"
@.str.3 = [13 x i8] c"Type 1: %s \0A\00"
@.str.4 = [13 x i8] c"Type 2: %s \0A\00"
@.str.5 = [13 x i8] c"Type 3: %s \0A\00"
@.str.6 = [20 x i8] c"Next for str1: %c \0A\00"
@.str.7 = [20 x i8] c"Next for str2: %c \0A\00"
@.str.8 = [20 x i8] c"Next for str3: %c \0A\00"
@__const.main.arr1 = [5 x i32] [i32 5, i32 6, i32 7, i32 8, i32 9]
@__const.main.arr2 = [5 x i32] [i32 42, i32 57, i32 63, i32 90, i32 94]
@.str.9 = [15 x i8] c"Min arr1: %d \0A\00"
@.str.10 = [15 x i8] c"Max arr1: %d \0A\00"
@.str.11 = [15 x i8] c"Min arr2: %d \0A\00"
@.str.12 = [15 x i8] c"Max arr2: %d \0A\00"
define i32 @main() {
%1 = alloca [5 x i32]
%2 = alloca [5 x i32]
%3 = tail call i8* @whattype(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%4 = tail call i8* @whattype(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i8* @whattype(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %3)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %4)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i8* %5)
%9 = tail call i32 @next(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %9)
%11 = tail call i32 @next(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 %11)
%13 = tail call i32 @next(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 %13)
%15 = bitcast [5 x i32]* %1 to i8*
%16 = bitcast [5 x i32]* %2 to i8*
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%18 = call i32 @min(i32* %17)
%19 = call i32 @max(i32* %17)
%20 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%21 = call i32 @min(i32* %20)
%22 = call i32 @max(i32* %20)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %18)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 %19)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.11, i64 0, i64 0), i32 %21)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0), i32 %22)
ret i32 0
}