#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 femocs_interface(int const, double *, double *, double *, double const,
                     double *, double *, double *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  const int n_atoms = 1;
  double *x = NULL, *y = NULL, *z = NULL, Ex[2000], Ey[2000], Ez[2000];
  const double Eappl = 0.2;
  int success = femocs_interface(n_atoms, x, y, z, Eappl, Ex, Ey, Ez);
  if (success)
    printf("Error occured. Success  =  %d\n", success);
  else
    printf("Femocs run successfully\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xbbc0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movsd  0xea7(%rip),%xmm0
movsd  %xmm0,-0xbba8(%rbp)
ff
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x3ea0(%rbp),%r8
lea    -0x7d20(%rbp),%r9
lea    -0xbba0(%rbp),%rax
mov    $0x1,%edi
movsd  0xe71(%rip),%xmm0
mov    %rax,(%rsp)
call   1040 <femocs_interface@plt>
mov    %eax,-0xbbac(%rbp)
cmpl   $0x0,-0xbbac(%rbp)
je     11c4 <main+0xa4>
mov    -0xbbac(%rbp),%esi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d2 <main+0xb2>
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xbbc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xbb98,%rsp
lea    0x10(%rsp),%rax
mov    %rax,(%rsp)
movsd  0xeb8(%rip),%xmm0
lea    0x7d10(%rsp),%r8
lea    0x3e90(%rsp),%r9
mov    $0x1,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <femocs_interface@plt>
test   %eax,%eax
je     117e <main+0x4e>
lea    0xe95(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    118a <main+0x5a>
lea    0xea2(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xbb98,%rsp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Error occured. Success = %d\0A\00"
@.str.1 = [25 x i8] c"Femocs run successfully\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double*
%4 = alloca double*
%5 = alloca double*
%6 = alloca [2000 x double]
%7 = alloca [2000 x double]
%8 = alloca [2000 x double]
%9 = alloca double
%10 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store double* null, double** %3
store double* null, double** %4
store double* null, double** %5
store double 2.000000e-01, double* %9
%11 = load double*, double** %3
%12 = load double*, double** %4
%13 = load double*, double** %5
%14 = getelementptr inbounds [2000 x double], [2000 x double]* %6, i64 0, i64 0
%15 = getelementptr inbounds [2000 x double], [2000 x double]* %7, i64 0, i64 0
%16 = getelementptr inbounds [2000 x double], [2000 x double]* %8, i64 0, i64 0
%17 = call i32 @femocs_interface(i32 1, double* %11, double* %12, double* %13, double 2.000000e-01, double* %14, double* %15, double* %16)
store i32 %17, i32* %10
%18 = load i32, i32* %10
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %23
20: ; preds = %0
%21 = load i32, i32* %10
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %21)
br label %25
23: ; preds = %0
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %23, %20
ret i32 0
}

LLVM IR (-O2):
@.str = [31 x i8] c"Error occured. Success = %d\0A\00"
@str = [24 x i8] c"Femocs run successfully\00"
define i32 @main() {
%1 = alloca [2000 x double]
%2 = alloca [2000 x double]
%3 = alloca [2000 x double]
%4 = bitcast [2000 x double]* %1 to i8*
%5 = bitcast [2000 x double]* %2 to i8*
%6 = bitcast [2000 x double]* %3 to i8*
%7 = getelementptr inbounds [2000 x double], [2000 x double]* %1, i64 0, i64 0
%8 = getelementptr inbounds [2000 x double], [2000 x double]* %2, i64 0, i64 0
%9 = getelementptr inbounds [2000 x double], [2000 x double]* %3, i64 0, i64 0
%10 = call i32 @femocs_interface(i32 1, double* null, double* null, double* null, double 2.000000e-01, double* %7, double* %8, double* %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %16
14: ; preds = %0
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
ret i32 0
}