#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 atoi(char *);
int *malloc(int);
int pow(int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rescure(int, int *, int);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  if (argc != 2) {
    printf("the number of args is wrong!\n");
    return -1;
  }
  int n = atoi(argv[1]);
  int deep = atoi(argv[1]);
  int *array = malloc(sizeof(int) * (pow(2, deep)));
  rescure(deep, array, n);
  sleep(100);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     1198 <main+0x38>
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11f6 <main+0x96>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    $0x2,%edi
call   1060 <pow@plt>
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <rescure@plt>
mov    $0x64,%edi
call   1080 <sleep@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jne    11a3 <main+0x43>
mov    0x8(%rsi),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebx
mov    $0x2,%edi
mov    %eax,%esi
call   1060 <pow@plt>
lea    0x0(,%rax,4),%edi
call   1050 <malloc@plt>
mov    %ebx,%edi
mov    %rax,%rsi
mov    %ebx,%edx
call   1040 <rescure@plt>
mov    $0x64,%edi
call   1080 <sleep@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe56(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"the number of args is wrong!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %33
13: ; preds = %2
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @atoi(i8* %16)
store i32 %17, i32* %6
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
%21 = call i32 @atoi(i8* %20)
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = call i32 @pow(i32 2, i32 %22)
%24 = sext i32 %23 to i64
%25 = mul i64 4, %24
%26 = trunc i64 %25 to i32
%27 = call i32* @malloc(i32 %26)
store i32* %27, i32** %8
%28 = load i32, i32* %7
%29 = load i32*, i32** %8
%30 = load i32, i32* %6
%31 = call i32 @rescure(i32 %28, i32* %29, i32 %30)
%32 = call i32 @sleep(i32 100)
store i32 0, i32* %3
br label %33
33: ; preds = %13, %11
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
@str = [29 x i8] c"the number of args is wrong!\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %15
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @atoi(i8* %8)
%10 = tail call i32 @pow(i32 2, i32 %9)
%11 = shl i32 %10, 2
%12 = tail call i32* @malloc(i32 %11)
%13 = tail call i32 @rescure(i32 %9, i32* %12, i32 %9)
%14 = tail call i32 @sleep(i32 100)
br label %15
15: ; preds = %6, %4
%16 = phi i32 [ -1, %4 ], [ 0, %6 ]
ret i32 %16
}