#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 /*<<< orphan*/ printf(char *, int, int, double);
double workfactor(int, int, int);
int main(int argc, char **argv) {
  int n, k, t, m, tmin, tmax;
  m = atoi(argv[1]);
  n = 1 << m;
  t = (argc > 2) ? atoi(argv[2]) : 0;
  if (t != 0)
    tmin = tmax = t;
  else {
    tmin = 2;
    tmax = n / m;
  }
  for (t = tmin; t <= tmax; ++t) {
    k = n - t * m;
    printf("%d\t%d\t%g\n", m, t, workfactor(n, k, t));
  }
  return 1;
}


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)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    1182 <main+0x52>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x2c(%rbp)
jmp    118c <main+0x5c>
xor    %eax,%eax
mov    %eax,-0x2c(%rbp)
jmp    118c <main+0x5c>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11aa <main+0x7a>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    %eax,-0x24(%rbp)
jmp    11bb <main+0x8b>
movl   $0x2,-0x24(%rbp)
mov    -0x14(%rbp),%eax
cltd
idivl  -0x20(%rbp)
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jg     1216 <main+0xe6>
mov    -0x14(%rbp),%eax
mov    -0x1c(%rbp),%ecx
imul   -0x20(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1050 <workfactor@plt>
mov    -0x34(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xdfd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11c1 <main+0x91>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x8(%rsi),%rdi
call   1040 <atoi@plt>
mov    %eax,%r12d
mov    $0x1,%r14d
mov    %r12d,%ecx
shl    %cl,%r14d
cmp    $0x3,%ebp
jl     116f <main+0x3f>
mov    0x10(%rbx),%rdi
call   1040 <atoi@plt>
mov    %eax,%r15d
mov    %eax,%ebp
test   %eax,%eax
jne    1183 <main+0x53>
mov    %r14d,%eax
cltd
idiv   %r12d
cmp    $0x2,%eax
jl     11c4 <main+0x94>
mov    %eax,%r15d
mov    $0x2,%ebp
add    $0x1,%r15d
mov    %r12d,%eax
imul   %ebp,%eax
mov    %r14d,%ebx
sub    %eax,%ebx
lea    0xe67(%rip),%r13
nopl   0x0(%rax)
mov    %r14d,%edi
mov    %ebx,%esi
mov    %ebp,%edx
call   1050 <workfactor@plt>
mov    %r13,%rdi
mov    %r12d,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
add    $0x1,%ebp
sub    %r12d,%ebx
cmp    %ebp,%r15d
jne    11a0 <main+0x70>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d\09%d\09%g\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
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 @atoi(i8* %14)
store i32 %15, i32* %9
%16 = load i32, i32* %9
%17 = shl i32 1, %16
store i32 %17, i32* %6
%18 = load i32, i32* %4
%19 = icmp sgt i32 %18, 2
br i1 %19, label %20, label %25
20: ; preds = %2
%21 = load i8**, i8*** %5
%22 = getelementptr inbounds i8*, i8** %21, i64 2
%23 = load i8*, i8** %22
%24 = call i32 @atoi(i8* %23)
br label %26
25: ; preds = %2
br label %26
26: ; preds = %25, %20
%27 = phi i32 [ %24, %20 ], [ 0, %25 ]
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = load i32, i32* %8
store i32 %31, i32* %11
store i32 %31, i32* %10
br label %36
32: ; preds = %26
store i32 2, i32* %10
%33 = load i32, i32* %6
%34 = load i32, i32* %9
%35 = sdiv i32 %33, %34
store i32 %35, i32* %11
br label %36
36: ; preds = %32, %30
%37 = load i32, i32* %10
store i32 %37, i32* %8
br label %38
38: ; preds = %55, %36
%39 = load i32, i32* %8
%40 = load i32, i32* %11
%41 = icmp sle i32 %39, %40
br i1 %41, label %42, label %58
42: ; preds = %38
%43 = load i32, i32* %6
%44 = load i32, i32* %8
%45 = load i32, i32* %9
%46 = mul nsw i32 %44, %45
%47 = sub nsw i32 %43, %46
store i32 %47, i32* %7
%48 = load i32, i32* %9
%49 = load i32, i32* %8
%50 = load i32, i32* %6
%51 = load i32, i32* %7
%52 = load i32, i32* %8
%53 = call double @workfactor(i32 %50, i32 %51, i32 %52)
%54 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %48, i32 %49, double %53)
br label %55
55: ; preds = %42
%56 = load i32, i32* %8
%57 = add nsw i32 %56, 1
store i32 %57, i32* %8
br label %38
58: ; preds = %38
ret i32 1
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d\09%d\09%g\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = shl nuw i32 1, %5
%7 = icmp sgt i32 %0, 2
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %8, %2
%14 = sdiv i32 %6, %5
%15 = icmp slt i32 %14, 2
br i1 %15, label %27, label %16
16: ; preds = %8, %13
%17 = phi i32 [ %14, %13 ], [ %11, %8 ]
%18 = phi i32 [ 2, %13 ], [ %11, %8 ]
br label %19
19: ; preds = %16, %19
%20 = phi i32 [ %25, %19 ], [ %18, %16 ]
%21 = mul nsw i32 %20, %5
%22 = sub nsw i32 %6, %21
%23 = tail call double @workfactor(i32 %6, i32 %22, i32 %20)
%24 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %20, double %23)
%25 = add i32 %20, 1
%26 = icmp eq i32 %20, %17
br i1 %26, label %27, label %19
27: ; preds = %19, %13
ret i32 1
}