#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int set_problem_size(int argc, char **argv) {
  int n;
  printf("%s %s\n", "qn24b XeonPhiPthread", "version 1.0.0 2013-08-03");
  if (argc != 2) {
    printf("Usage: %s n\n", argv[0]);
    exit(0);
  }
  n = atoi(argv[1]);
  if (2 > n || 29 < n) {
    printf("board size range: %d-%d\n", 2, 29);
    exit(0);
  }
  return n;
}


x86 assembly (clang, -O0):
<set_problem_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeba(%rip),%rdi
lea    0xeba(%rip),%rsi
lea    0xec8(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2,-0x4(%rbp)
je     1181 <set_problem_size+0x51>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    $0x2,%eax
cmp    -0x14(%rbp),%eax
jg     11ad <set_problem_size+0x7d>
mov    $0x1d,%eax
cmp    -0x14(%rbp),%eax
jge    11cc <set_problem_size+0x9c>
lea    0xe8e(%rip),%rdi
mov    $0x2,%esi
mov    $0x1d,%edx
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_problem_size>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rdi
lea    0xec1(%rip),%rsi
lea    0xecf(%rip),%rdx
xor    %eax,%eax
call   1030 <printf@plt>
cmp    $0x2,%ebp
jne    1171 <set_problem_size+0x41>
mov    0x8(%rbx),%rdi
call   1040 <atoi@plt>
lea    -0x1e(%rax),%ecx
cmp    $0xffffffe3,%ecx
jbe    1189 <set_problem_size+0x59>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    (%rbx),%rsi
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
lea    0xeb2(%rip),%rdi
mov    $0x2,%esi
mov    $0x1d,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [21 x i8] c"qn24b XeonPhiPthread\00"
@.str.2 = [25 x i8] c"version 1.0.0 2013-08-03\00"
@.str.3 = [13 x i8] c"Usage: %s n\0A\00"
@.str.4 = [25 x i8] c"board size range: %d-%d\0A\00"
define i32 @set_problem_size(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %12)
%14 = call i32 @exit(i32 0)
unreachable
15: ; preds = %2
%16 = load i8**, i8*** %4
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @atoi(i8* %18)
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = icmp sgt i32 2, %20
br i1 %21, label %25, label %22
22: ; preds = %15
%23 = load i32, i32* %5
%24 = icmp slt i32 29, %23
br i1 %24, label %25, label %28
25: ; preds = %22, %15
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 29)
%27 = call i32 @exit(i32 0)
unreachable
28: ; preds = %22
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s %s\0A\00"
@.str.1 = [21 x i8] c"qn24b XeonPhiPthread\00"
@.str.2 = [25 x i8] c"version 1.0.0 2013-08-03\00"
@.str.3 = [13 x i8] c"Usage: %s n\0A\00"
@.str.4 = [25 x i8] c"board size range: %d-%d\0A\00"
define i32 @set_problem_size(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%4 = icmp eq i32 %0, 2
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = load i8*, i8** %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%8 = tail call i32 @exit(i32 0)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i32 @atoi(i8* %11)
%13 = add i32 %12, -30
%14 = icmp ult i32 %13, -28
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 29)
%17 = tail call i32 @exit(i32 0)
unreachable
18: ; preds = %9
ret i32 %12
}