#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(argv[0]);
    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    119b <main+0x3b>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x0,%al
call   1060 <error_print@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe5e(%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  0xe35(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    11f2 <main+0x92>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe1f(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <sscanf@plt>
cmpl   $0x4,-0x4(%rbp)
jne    122c <main+0xcc>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdfd(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xde5(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <sscanf@plt>
cmpl   $0x5,-0x4(%rbp)
jne    127e <main+0x11e>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xdc3(%rip),%rsi
lea    -0x28(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xdab(%rip),%rsi
lea    -0x20(%rbp),%rdx
call   1050 <sscanf@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
lea    0xd93(%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    %rsi,%r15
mov    %edi,%ebx
lea    -0x6(%rbx),%eax
cmp    $0xfffffffb,%eax
jbe    1258 <main+0xf8>
mov    0x8(%r15),%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
mov    (%r15),%rdi
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 %19
14: ; preds = %11, %2
%15 = load i8**, i8*** %4
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 @exit(i32 1)
unreachable
19: ; preds = %11
%20 = load i8**, i8*** %4
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @sscanf(i8* %22, 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
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 3
br i1 %25, label %26, label %31
26: ; preds = %19
%27 = load i8**, i8*** %4
%28 = getelementptr inbounds i8*, i8** %27, i64 2
%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* %7)
br label %31
31: ; preds = %26, %19
%32 = load i32, i32* %3
%33 = icmp eq i32 %32, 4
br i1 %33, label %34, label %43
34: ; preds = %31
%35 = load i8**, i8*** %4
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = call i32 @sscanf(i8* %37, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%39 = load i8**, i8*** %4
%40 = getelementptr inbounds i8*, i8** %39, i64 3
%41 = load i8*, i8** %40
%42 = call i32 @sscanf(i8* %41, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
br label %43
43: ; preds = %34, %31
%44 = load i32, i32* %3
%45 = icmp eq i32 %44, 5
br i1 %45, label %46, label %59
46: ; preds = %43
%47 = load i8**, i8*** %4
%48 = getelementptr inbounds i8*, i8** %47, i64 2
%49 = load i8*, i8** %48
%50 = call i32 @sscanf(i8* %49, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %7)
%51 = load i8**, i8*** %4
%52 = getelementptr inbounds i8*, i8** %51, i64 3
%53 = load i8*, i8** %52
%54 = call i32 @sscanf(i8* %53, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %6)
%55 = load i8**, i8*** %4
%56 = getelementptr inbounds i8*, i8** %55, i64 4
%57 = load i8*, i8** %56
%58 = call i32 @sscanf(i8* %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %8)
br label %59
59: ; preds = %46, %43
%60 = call i32 (...) @read_field()
%61 = load double, double* %5
%62 = load double, double* %6
%63 = load double, double* %7
%64 = load double, double* %8
%65 = call i32 @gauss_scr(double %61, double %62, double %63, double %64)
%66 = 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 %16
13: ; preds = %2
%14 = load i8*, i8** %1
tail call void (i8*, ...) bitcast (void (...)* @error_print to void (i8*, ...)*)(i8* %14)
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %2
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = call i32 @sscanf(i8* %18, 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 %38 [
i32 3, label %32
i32 4, label %24
i32 5, label %20
]
20: ; preds = %16
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = call i32 @sscanf(i8* %22, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %5)
br label %24
24: ; preds = %16, %20
%25 = phi i64 [ 3, %20 ], [ 2, %16 ]
%26 = phi double* [ %4, %20 ], [ %5, %16 ]
%27 = phi i64 [ 4, %20 ], [ 3, %16 ]
%28 = phi double* [ %6, %20 ], [ %4, %16 ]
%29 = getelementptr inbounds i8*, i8** %1, i64 %25
%30 = load i8*, i8** %29
%31 = call i32 @sscanf(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %26)
br label %32
32: ; preds = %24, %16
%33 = phi i64 [ 2, %16 ], [ %27, %24 ]
%34 = phi double* [ %5, %16 ], [ %28, %24 ]
%35 = getelementptr inbounds i8*, i8** %1, i64 %33
%36 = load i8*, i8** %35
%37 = call i32 @sscanf(i8* %36, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double* %34)
br label %38
38: ; preds = %32, %16
%39 = call i32 (...) @read_field()
%40 = load double, double* %3
%41 = load double, double* %4
%42 = load double, double* %5
%43 = load double, double* %6
%44 = call i32 @gauss_scr(double %40, double %41, double %42, double %43)
%45 = call i32 (...) @write_field()
ret void
}