#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_list(int, int, int, int, int, int, int, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int number = 0;
  int temp = 0;
  int I_array[10] = {0};
  printf("There is a available variabel parameter\nlist for the undefined "
         "parameter in the function.You also\nshould enter a integer number "
         "for the first parameter.\n");
  while (!scanf("%d", &number)) {
    printf("Please enter again !The data you entered is wrong!");
  }
  printf("\n\nThe Max number in the parameter list is : %d\n",
         max_list(number, 1, 2, 3, 4, 5, 6, 7, -1));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf18(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11a0 <main+0x60>
jmp    11b3 <main+0x73>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117b <main+0x3b>
mov    -0x8(%rbp),%edi
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
movl   $0x6,(%rsp)
movl   $0x7,0x8(%rsp)
movl   $0xffffffff,0x10(%rsp)
ff
call   1050 <max_list@plt>
mov    %eax,%esi
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
test   %eax,%eax
jne    11a9 <main+0x69>
lea    0xe8a(%rip),%r14
lea    0xe80(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
test   %eax,%eax
je     1190 <main+0x50>
mov    0xc(%rsp),%edi
sub    $0x8,%rsp
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
push   $0xffffffffffffffff
push   $0x7
push   $0x6
call   1050 <max_list@plt>
add    $0x20,%rsp
lea    0xe54(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [154 x i8] c"There is a available variabel parameter\0Alist for the undefined parameter in the function.You also\0Ashould enter a integer number for the first parameter.\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [51 x i8] c"Please enter again !The data you entered is wrong!\00"
@.str.3 = [48 x i8] c"\0A\0AThe Max number in the parameter list is : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca [10 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
%5 = bitcast [10 x i32]* %4 to i8*
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %11, %0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
br label %7
13: ; preds = %7
%14 = load i32, i32* %2
%15 = call i32 @max_list(i32 %14, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 -1)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [51 x i8] c"Please enter again !The data you entered is wrong!\00"
@.str.3 = [48 x i8] c"\0A\0AThe Max number in the parameter list is : %d\0A\00"
@str = [153 x i8] c"There is a available variabel parameter\0Alist for the undefined parameter in the function.You also\0Ashould enter a integer number for the first parameter.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([153 x i8], [153 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %0, %6
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%9 = icmp eq i32 %8, 0
br i1 %9, label %6, label %10
10: ; preds = %6, %0
%11 = load i32, i32* %1
%12 = call i32 @max_list(i32 %11, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 -1)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i64 0, i64 0), i32 %12)
ret i32 0
}