#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*/ exit(int);
int /*<<< orphan*/ gauss_scr(double, double, double, double);
int /*<<< orphan*/ read_field();
int /*<<< orphan*/ sscanf(char *, char *, double *);
int /*<<< orphan*/ write_field();
void main(int argc, char *argv[]) {
  void error_print();
  double R, x_shift, y_shift, AA;
  if (argc < 2 || argc > 5) {
    error_print();
    exit(1);
  }
  sscanf(argv[1], "%le", &R);
  x_shift = y_shift = 0.;
  AA = 1.;
  if (argc == 3)
    sscanf(argv[2], "%le", &y_shift);
  if (argc == 4) {
    sscanf(argv[2], "%le", &y_shift);
    sscanf(argv[3], "%le", &x_shift);
  }
  if (argc == 5) {
    sscanf(argv[2], "%le", &y_shift);
    sscanf(argv[3], "%le", &x_shift);
    sscanf(argv[4], "%le", &AA);
  }
  read_field();
  gauss_scr(R, x_shift, y_shift, AA);
  write_field();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
jl     1183 <main+0x23>
cmpl   $0x5,-0x4(%rbp)
jle    1194 <main+0x34>
mov    $0x0,%al
call   1060 <error_print@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe65(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <sscanf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe3c(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    11eb <main+0x8b>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe26(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <sscanf@plt>
cmpl   $0x4,-0x4(%rbp)
jne    1225 <main+0xc5>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe04(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdec(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <sscanf@plt>
cmpl   $0x5,-0x4(%rbp)
jne    1277 <main+0x117>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdca(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdb2(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xd9a(%rip),%rsi
lea    -0x30(%rbp),%rdx
call   1050 <sscanf@plt>
mov    $0x0,%al
call   1030 <read_field@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
call   1040 <gauss_scr@plt>
mov    $0x0,%al
call   1080 <write_field@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %edi,%ebx
lea    -0x6(%rbx),%eax
cmp    $0xfffffffb,%eax
jbe    1258 <main+0xf8>
mov    %rsi,%r15
mov    0x8(%rsi),%rdi
lea    0xe7b(%rip),%rsi
lea    0x18(%rsp),%rdx
call   1050 <sscanf@plt>
movq   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x10(%rsp)
mov    %rsp,%rdx
mov    $0x2,%eax
cmp    $0x3,%ebx
je     120e <main+0xae>
cmp    $0x4,%ebx
je     11ef <main+0x8f>
cmp    $0x5,%ebx
jne    1224 <main+0xc4>
mov    0x10(%r15),%rdi
lea    0xe2f(%rip),%rsi
mov    %rsp,%rdx
call   1050 <sscanf@plt>
lea    0x10(%rsp),%r14
mov    $0x4,%ebx
lea    0x8(%rsp),%rdx
mov    $0x3,%eax
jmp    11f9 <main+0x99>
lea    0x8(%rsp),%r14
mov    $0x3,%ebx
mov    (%r15,%rax,8),%rdi
lea    0xdfc(%rip),%rsi
call   1050 <sscanf@plt>
mov    %rbx,%rax
jmp    1211 <main+0xb1>
mov    %rdx,%r14
mov    (%r15,%rax,8),%rdi
lea    0xde4(%rip),%rsi
mov    %r14,%rdx
call   1050 <sscanf@plt>
xor    %eax,%eax
call   1030 <read_field@plt>
movsd  0x18(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  (%rsp),%xmm2
movsd  0x10(%rsp),%xmm3
call   1040 <gauss_scr@plt>
xor    %eax,%eax
call   1080 <write_field@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret
xor    %eax,%eax
call   1060 <error_print@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%le\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32 %0, i32* %3
store i8** %1, i8*** %4
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 2
br i1 %10, label %14, label %11
11: ; preds = %2
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 5
br i1 %13, label %14, label %16
14: ; preds = %11, %2
%15 = call i32 @exit(i32 1)
unreachable
16: ; preds = %11
%17 = load i8**, i8*** %4
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @sscanf(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %5)
store double 0.000000e+00, double* %7
store double 0.000000e+00, double* %6
store double 1.000000e+00, double* %8
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 3
br i1 %22, label %23, label %28
23: ; preds = %16
%24 = load i8**, i8*** %4
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = call i32 @sscanf(i8* %26, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
br label %28
28: ; preds = %23, %16
%29 = load i32, i32* %3
%30 = icmp eq i32 %29, 4
br i1 %30, label %31, label %40
31: ; preds = %28
%32 = load i8**, i8*** %4
%33 = getelementptr inbounds i8*, i8** %32, i64 2
%34 = load i8*, i8** %33
%35 = call i32 @sscanf(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%36 = load i8**, i8*** %4
%37 = getelementptr inbounds i8*, i8** %36, i64 3
%38 = load i8*, i8** %37
%39 = call i32 @sscanf(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
br label %40
40: ; preds = %31, %28
%41 = load i32, i32* %3
%42 = icmp eq i32 %41, 5
br i1 %42, label %43, label %56
43: ; preds = %40
%44 = load i8**, i8*** %4
%45 = getelementptr inbounds i8*, i8** %44, i64 2
%46 = load i8*, i8** %45
%47 = call i32 @sscanf(i8* %46, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%48 = load i8**, i8*** %4
%49 = getelementptr inbounds i8*, i8** %48, i64 3
%50 = load i8*, i8** %49
%51 = call i32 @sscanf(i8* %50, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%52 = load i8**, i8*** %4
%53 = getelementptr inbounds i8*, i8** %52, i64 4
%54 = load i8*, i8** %53
%55 = call i32 @sscanf(i8* %54, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %8)
br label %56
56: ; preds = %43, %40
%57 = call i32 (...) @read_field()
%58 = load double, double* %5
%59 = load double, double* %6
%60 = load double, double* %7
%61 = load double, double* %8
%62 = call i32 @gauss_scr(double %58, double %59, double %60, double %61)
%63 = call i32 (...) @write_field()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%le\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = bitcast double* %3 to i8*
%8 = bitcast double* %4 to i8*
%9 = bitcast double* %5 to i8*
%10 = bitcast double* %6 to i8*
%11 = add i32 %0, -6
%12 = icmp ult i32 %11, -4
br i1 %12, label %13, label %15
13: ; preds = %2
tail call void (...) @error_print()
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @sscanf(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %3)
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %4
store double 1.000000e+00, double* %6
switch i32 %0, label %37 [
i32 3, label %31
i32 4, label %23
i32 5, label %19
]
19: ; preds = %15
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = call i32 @sscanf(i8* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %5)
br label %23
23: ; preds = %15, %19
%24 = phi i64 [ 3, %19 ], [ 2, %15 ]
%25 = phi double* [ %4, %19 ], [ %5, %15 ]
%26 = phi i64 [ 4, %19 ], [ 3, %15 ]
%27 = phi double* [ %6, %19 ], [ %4, %15 ]
%28 = getelementptr inbounds i8*, i8** %1, i64 %24
%29 = load i8*, i8** %28
%30 = call i32 @sscanf(i8* %29, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %25)
br label %31
31: ; preds = %23, %15
%32 = phi i64 [ 2, %15 ], [ %26, %23 ]
%33 = phi double* [ %5, %15 ], [ %27, %23 ]
%34 = getelementptr inbounds i8*, i8** %1, i64 %32
%35 = load i8*, i8** %34
%36 = call i32 @sscanf(i8* %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %33)
br label %37
37: ; preds = %31, %15
%38 = call i32 (...) @read_field()
%39 = load double, double* %3
%40 = load double, double* %4
%41 = load double, double* %5
%42 = load double, double* %6
%43 = call i32 @gauss_scr(double %39, double %40, double %41, double %42)
%44 = call i32 (...) @write_field()
ret void
}