#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 powe(int, int);
int /*<<< orphan*/ printf(char *, ...);
double prob(int, int, int, int);
int main(int argc, char *argv[]) {
  int k, N, i, l;
  int n_dash;
  if (argc != 2)
    return 0;
  else {
    k = atoi(argv[1]);
    N = powe(2, k);
    n_dash = 1;
    for (i = 1; i <= k; i++) {
      printf("hello");
      printf("%d %f\n", i, prob(i, n_dash, k, N));
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     116c <main+0x2c>
movl   $0x0,-0x4(%rbp)
jmp    11ef <main+0xaf>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x2,%edi
call   1040 <powe@plt>
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11ea <main+0xaa>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1060 <prob@plt>
mov    -0x28(%rbp),%esi
lea    0xe31(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    119a <main+0x5a>
jmp    11ef <main+0xaf>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jne    11ca <main+0x8a>
mov    0x8(%rsi),%rdi
call   1050 <atoi@plt>
mov    %eax,%r13d
mov    $0x2,%edi
mov    %eax,%esi
call   1040 <powe@plt>
test   %r13d,%r13d
jle    11ca <main+0x8a>
mov    %eax,%r15d
mov    %r13d,%ebx
neg    %ebx
mov    $0x1,%ebp
lea    0xe7f(%rip),%r14
lea    0xe7e(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebp,%edi
mov    $0x1,%esi
mov    %r13d,%edx
mov    %r15d,%ecx
call   1060 <prob@plt>
mov    %r12,%rdi
mov    %ebp,%esi
mov    $0x1,%al
call   1030 <printf@plt>
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%ecx
add    $0x1,%ecx
mov    %ecx,%ebp
cmp    $0x1,%eax
jne    1190 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [7 x i8] c"%d %f\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
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i32, i32* %4
%12 = icmp ne i32 %11, 2
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %38
14: ; preds = %2
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
store i32 %18, i32* %6
%19 = load i32, i32* %6
%20 = call i32 @powe(i32 2, i32 %19)
store i32 %20, i32* %7
store i32 1, i32* %10
store i32 1, i32* %8
br label %21
21: ; preds = %34, %14
%22 = load i32, i32* %8
%23 = load i32, i32* %6
%24 = icmp sle i32 %22, %23
br i1 %24, label %25, label %37
25: ; preds = %21
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%27 = load i32, i32* %8
%28 = load i32, i32* %8
%29 = load i32, i32* %10
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = call double @prob(i32 %28, i32 %29, i32 %30, i32 %31)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %27, double %32)
br label %34
34: ; preds = %25
%35 = load i32, i32* %8
%36 = add nsw i32 %35, 1
store i32 %36, i32* %8
br label %21
37: ; preds = %21
br label %38
38: ; preds = %13, %37
%39 = load i32, i32* %3
ret i32 %39
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [7 x i8] c"%d %f\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 2
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @atoi(i8* %6)
%8 = tail call i32 @powe(i32 2, i32 %7)
%9 = icmp slt i32 %7, 1
br i1 %9, label %17, label %10
10: ; preds = %4, %10
%11 = phi i32 [ %15, %10 ], [ 1, %4 ]
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = tail call double @prob(i32 %11, i32 1, i32 %7, i32 %8)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %11, double %13)
%15 = add nuw i32 %11, 1
%16 = icmp eq i32 %11, %7
br i1 %16, label %17, label %10
17: ; preds = %10, %4, %2
ret i32 0
}