#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 /*<<< orphan*/ scanf(char *, long *);
long siracusa(long);
int main(int args, char *argv[]) {
  long param;
  printf("ingresar el parametro\n");
  scanf("%d", &param);
  long secuenciaMayor = 1, mayor = 1;
  for (long i = 1; i <= param; i++) {
    long Siracusa = siracusa(i);
    if (mayor < Siracusa) {
      mayor = Siracusa;
      secuenciaMayor = i;
    }
  }
  printf("secuencia mayor: %d \n.", secuenciaMayor);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movq   $0x1,-0x20(%rbp)
movq   $0x1,-0x28(%rbp)
movq   $0x1,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     11cb <main+0x9b>
mov    -0x30(%rbp),%rdi
call   1050 <siracusa@plt>
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
cmp    -0x38(%rbp),%rax
jge    11b5 <main+0x85>
mov    -0x38(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    11ba <main+0x8a>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    117c <main+0x4c>
mov    -0x20(%rbp),%rsi
lea    0xe44(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1050 <scanf@plt>
cmpq   $0x0,0x8(%rsp)
jle    11a0 <main+0x60>
mov    $0x1,%r14d
xor    %ebx,%ebx
mov    $0x1,%r15d
nopl   0x0(%rax)
add    $0x1,%rbx
mov    %rbx,%rdi
call   1060 <siracusa@plt>
cmp    %rax,%r15
cmovl  %rax,%r15
cmovl  %rbx,%r14
cmp    0x8(%rsp),%rbx
jl     1180 <main+0x40>
jmp    11a6 <main+0x66>
mov    $0x1,%r14d
lea    0xe56(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [23 x i8] c"ingresar el parametro\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"secuencia mayor: %d \0A.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64* %6)
store i64 1, i64* %7
store i64 1, i64* %8
store i64 1, i64* %9
br label %13
13: ; preds = %27, %2
%14 = load i64, i64* %9
%15 = load i64, i64* %6
%16 = icmp sle i64 %14, %15
br i1 %16, label %17, label %30
17: ; preds = %13
%18 = load i64, i64* %9
%19 = call i64 @siracusa(i64 %18)
store i64 %19, i64* %10
%20 = load i64, i64* %8
%21 = load i64, i64* %10
%22 = icmp slt i64 %20, %21
br i1 %22, label %23, label %26
23: ; preds = %17
%24 = load i64, i64* %10
store i64 %24, i64* %8
%25 = load i64, i64* %9
store i64 %25, i64* %7
br label %26
26: ; preds = %23, %17
br label %27
27: ; preds = %26
%28 = load i64, i64* %9
%29 = add nsw i64 %28, 1
store i64 %29, i64* %9
br label %13
30: ; preds = %13
%31 = load i64, i64* %7
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i64 %31)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"secuencia mayor: %d \0A.\00"
@str = [22 x i8] c"ingresar el parametro\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i64* %3)
%7 = load i64, i64* %3
%8 = icmp slt i64 %7, 1
br i1 %8, label %9, label %12
9: ; preds = %12, %2
%10 = phi i64 [ 1, %2 ], [ %19, %12 ]
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i64 %10)
ret i32 0
12: ; preds = %2, %12
%13 = phi i64 [ %19, %12 ], [ 1, %2 ]
%14 = phi i64 [ %20, %12 ], [ 1, %2 ]
%15 = phi i64 [ %18, %12 ], [ 1, %2 ]
%16 = call i64 @siracusa(i64 %14)
%17 = icmp slt i64 %15, %16
%18 = select i1 %17, i64 %16, i64 %15
%19 = select i1 %17, i64 %14, i64 %13
%20 = add nuw nsw i64 %14, 1
%21 = load i64, i64* %3
%22 = icmp slt i64 %14, %21
br i1 %22, label %12, label %9
}