#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 */
typedef int /*<<< orphan*/ local_data;
typedef int /*<<< orphan*/ line;

/* Variables and functions */
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ stdin;
int toupper(char);
void recursive_function(char *data, int data_size, int level) {
  char local_data[10000];
  char line[10];
  int c;
  data_size += sizeof(local_data);
  level++;
  printf("recursion level=%d, size=%d; continue? ", level, data_size);
  fgets(line, sizeof(line), stdin);
  c = toupper(line[0]);
  if (c == 'Y')
    recursive_function(local_data, data_size, level);
}


x86 assembly (clang, -O0):
<recursive_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2730,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movslq -0xc(%rbp),%rax
add    $0x2710,%rax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe88(%rip),%rdi
call   1040 <printf@plt>
lea    -0x272a(%rbp),%rdi
mov    0x2e5d(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1060 <fgets@plt>
movsbl -0x272a(%rbp),%edi
call   1030 <toupper@plt>
mov    %eax,-0x2730(%rbp)
cmpl   $0x59,-0x2730(%rbp)
jne    11c8 <recursive_function+0x88>
lea    -0x2720(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <recursive_function@plt>
add    $0x2730,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<recursive_function>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
add    $0x2710,%ebp
add    $0x1,%ebx
lea    0xea6(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1040 <printf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edx
lea    0xe(%rsp),%rdi
mov    $0xa,%esi
call   1060 <fgets@plt>
movsbl 0xe(%rsp),%edi
call   1030 <toupper@plt>
cmp    $0x59,%eax
jne    1193 <recursive_function+0x53>
mov    %ebp,%esi
mov    %ebx,%edx
call   1050 <recursive_function@plt>
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"recursion level=%d, size=%d; continue? \00"
@stdin = global i32 0
define void @recursive_function(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [10000 x i8]
%8 = alloca [10 x i8]
%9 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = add i64 %11, 10000
%13 = trunc i64 %12 to i32
store i32 %13, i32* %5
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
store i32 %15, i32* %6
%16 = load i32, i32* %6
%17 = load i32, i32* %5
%18 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %16, i32 %17)
%19 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%20 = load i32, i32* @stdin
%21 = call i32 @fgets(i8* %19, i32 10, i32 %20)
%22 = getelementptr inbounds [10 x i8], [10 x i8]* %8, i64 0, i64 0
%23 = load i8, i8* %22
%24 = call i32 @toupper(i8 signext %23)
store i32 %24, i32* %9
%25 = load i32, i32* %9
%26 = icmp eq i32 %25, 89
br i1 %26, label %27, label %31
27: ; preds = %3
%28 = getelementptr inbounds [10000 x i8], [10000 x i8]* %7, i64 0, i64 0
%29 = load i32, i32* %5
%30 = load i32, i32* %6
br label %31
31: ; preds = %27, %3
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"recursion level=%d, size=%d; continue? \00"
@stdin = global i32 0
define void @recursive_function(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%6 = add i32 %1, 10000
%7 = add nsw i32 %2, 1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %6)
%9 = load i32, i32* @stdin
%10 = call i32 @fgets(i8* %5, i32 10, i32 %9)
%11 = load i8, i8* %5
%12 = call i32 @toupper(i8 signext %11)
%13 = icmp eq i32 %12, 89
br i1 %13, label %14, label %15
14: ; preds = %3
br label %15
15: ; preds = %14, %3
ret void
}