#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 /*<<< orphan*/ printf(char *, ...);
void usage(char *name) {
  printf("Usage: %s [num] [method] [lines] [func] [term] [prec/iter]\n", name);
  printf("\n");
  printf("  - num:       number of threads (1 .. %d)\n", 1024);
  printf("  - method:    calculation method (1 .. 2)\n");
  printf("                 %1d: Gauß-Seidel\n", 1);
  printf("                 %1d: Jacobi\n", 2);
  printf("  - lines:     number of interlines (0 .. %d)\n", 10240);
  printf("                 matrixsize = (interlines * 8) + 9\n");
  printf("  - func:      interference function (1 .. 2)\n");
  printf("                 %1d: f(x,y) = 0\n", 1);
  printf(
      "                 %1d: f(x,y) = 2 * pi^2 * sin(pi * x) * sin(pi * y)\n",
      2);
  printf("  - term:      termination condition ( 1.. 2)\n");
  printf("                 %1d: sufficient precision\n", 1);
  printf("                 %1d: number of iterations\n", 2);
  printf("  - prec/iter: depending on term:\n");
  printf("                 precision:  1e-4 .. 1e-20\n");
  printf("                 iterations:    1 .. %d\n", 200000);
  printf("\n");
  printf("Example: %s 1 2 100 1 2 100 \n", name);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11b5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x400,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf30(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf41(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4c(%rip),%rdi
mov    $0x2800,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf8e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfaf(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xfbe(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xff0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1011(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x102a(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1043(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1058(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1076(%rip),%rdi
mov    $0x30d40,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x10a8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0x107a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xee6(%rip),%rdi
mov    $0x400,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1076(%rip),%rdi
call   1040 <puts@plt>
lea    0xef3(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf04(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf0f(%rip),%rdi
mov    $0x2800,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x105c(%rip),%rdi
call   1040 <puts@plt>
lea    0x1083(%rip),%rdi
call   1040 <puts@plt>
lea    0xf13(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf22(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x107f(%rip),%rdi
call   1040 <puts@plt>
lea    0xf48(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf61(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x107b(%rip),%rdi
call   1040 <puts@plt>
lea    0x1091(%rip),%rdi
call   1040 <puts@plt>
lea    0xf62(%rip),%rdi
mov    $0x30d40,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xf6e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [60 x i8] c"Usage: %s [num] [method] [lines] [func] [term] [prec/iter]\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [44 x i8] c" - num: number of threads (1 .. %d)\0A\00"
@.str.3 = [44 x i8] c" - method: calculation method (1 .. 2)\0A\00"
@.str.4 = [36 x i8] c" %1d: Gau\C3\9F-Seidel\0A\00"
@.str.5 = [30 x i8] c" %1d: Jacobi\0A\00"
@.str.6 = [47 x i8] c" - lines: number of interlines (0 .. %d)\0A\00"
@.str.7 = [52 x i8] c" matrixsize = (interlines * 8) + 9\0A\00"
@.str.8 = [47 x i8] c" - func: interference function (1 .. 2)\0A\00"
@.str.9 = [34 x i8] c" %1d: f(x,y) = 0\0A\00"
@.str.10 = [69 x i8] c" %1d: f(x,y) = 2 * pi^2 * sin(pi * x) * sin(pi * y)\0A\00"
@.str.11 = [47 x i8] c" - term: termination condition ( 1.. 2)\0A\00"
@.str.12 = [44 x i8] c" %1d: sufficient precision\0A\00"
@.str.13 = [44 x i8] c" %1d: number of iterations\0A\00"
@.str.14 = [35 x i8] c" - prec/iter: depending on term:\0A\00"
@.str.15 = [44 x i8] c" precision: 1e-4 .. 1e-20\0A\00"
@.str.16 = [41 x i8] c" iterations: 1 .. %d\0A\00"
@.str.17 = [30 x i8] c"Example: %s 1 2 100 1 2 100 \0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i32 1024)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 1)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), i32 10240)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.7, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.8, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i32 1)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.10, i64 0, i64 0), i32 2)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.11, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.12, i64 0, i64 0), i32 1)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.13, i64 0, i64 0), i32 2)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.14, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.15, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.16, i64 0, i64 0), i32 200000)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%22 = load i8*, i8** %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.17, i64 0, i64 0), i8* %22)
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"Usage: %s [num] [method] [lines] [func] [term] [prec/iter]\0A\00"
@.str.2 = [44 x i8] c" - num: number of threads (1 .. %d)\0A\00"
@.str.4 = [36 x i8] c" %1d: Gau\C3\9F-Seidel\0A\00"
@.str.5 = [30 x i8] c" %1d: Jacobi\0A\00"
@.str.6 = [47 x i8] c" - lines: number of interlines (0 .. %d)\0A\00"
@.str.9 = [34 x i8] c" %1d: f(x,y) = 0\0A\00"
@.str.10 = [69 x i8] c" %1d: f(x,y) = 2 * pi^2 * sin(pi * x) * sin(pi * y)\0A\00"
@.str.12 = [44 x i8] c" %1d: sufficient precision\0A\00"
@.str.13 = [44 x i8] c" %1d: number of iterations\0A\00"
@.str.16 = [41 x i8] c" iterations: 1 .. %d\0A\00"
@.str.17 = [30 x i8] c"Example: %s 1 2 100 1 2 100 \0A\00"
@str = [43 x i8] c" - method: calculation method (1 .. 2)\00"
@str.18 = [51 x i8] c" matrixsize = (interlines * 8) + 9\00"
@str.19 = [46 x i8] c" - func: interference function (1 .. 2)\00"
@str.20 = [46 x i8] c" - term: termination condition ( 1.. 2)\00"
@str.21 = [34 x i8] c" - prec/iter: depending on term:\00"
@str.22 = [43 x i8] c" precision: 1e-4 .. 1e-20\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @putchar(i32 10)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0), i32 1024)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 1)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 2)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), i32 10240)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.18, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.19, i64 0, i64 0))
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.9, i64 0, i64 0), i32 1)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.10, i64 0, i64 0), i32 2)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.20, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.12, i64 0, i64 0), i32 1)
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.13, i64 0, i64 0), i32 2)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.21, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str.22, i64 0, i64 0))
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.16, i64 0, i64 0), i32 200000)
%19 = tail call i32 @putchar(i32 10)
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.17, i64 0, i64 0), i8* %0)
ret void
}