#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 */
typedef int /*<<< orphan*/ ps1;
typedef int /*<<< orphan*/ pg6;
typedef int /*<<< orphan*/ pg2;
typedef int /*<<< orphan*/ pg1;
typedef int /*<<< orphan*/ cl1;

/* Variables and functions */
int /*<<< orphan*/ gmshFinalize(int *);
int /*<<< orphan*/ gmshInitialize(int, char **, int, int *);
int /*<<< orphan*/ gmshModelAdd(char *, int *);
int /*<<< orphan*/ gmshModelAddPhysicalGroup(int, int *, int, int, int *);
int /*<<< orphan*/ gmshModelGeoAddCurveLoop(int *, int, int, int *);
int /*<<< orphan*/ gmshModelGeoAddLine(int, int, int, int *);
int /*<<< orphan*/ gmshModelGeoAddPlaneSurface(int *, int, int, int *);
int /*<<< orphan*/ gmshModelGeoAddPoint(double, double, int /*<<< orphan*/,
                                        double, int, int *);
int /*<<< orphan*/ gmshModelGeoSynchronize(int *);
int /*<<< orphan*/ gmshModelMeshGenerate(int, int *);
int /*<<< orphan*/ gmshModelSetPhysicalName(int, int, char *, int *);
int /*<<< orphan*/ gmshOptionSetNumber(char *, int, int *);
int /*<<< orphan*/ gmshWrite(char *, int *);
int main(int argc, char **argv) {
  int ierr;
  double lc = 1e-2;
  int cl1[] = {4, 1, -2, 3}, ps1[] = {1};
  int pg1[] = {1, 2}, pg2[] = {1, 2}, pg6[] = {1};
  gmshInitialize(argc, argv, 1, &ierr);
  gmshOptionSetNumber("General.Terminal", 1, &ierr);
  gmshModelAdd("t1", &ierr);
  gmshModelGeoAddPoint(0, 0, 0, lc, 1, &ierr);
  gmshModelGeoAddPoint(.1, 0, 0, lc, 2, &ierr);
  gmshModelGeoAddPoint(.1, .3, 0, lc, 3, &ierr);
  gmshModelGeoAddPoint(0, .3, 0, lc, 4, &ierr);
  gmshModelGeoAddLine(1, 2, 1, &ierr);
  gmshModelGeoAddLine(3, 2, 2, &ierr);
  gmshModelGeoAddLine(3, 4, 3, &ierr);
  gmshModelGeoAddLine(4, 1, 4, &ierr);
  gmshModelGeoAddCurveLoop(cl1, sizeof(cl1) / sizeof(cl1[0]), 1, &ierr);
  gmshModelGeoAddPlaneSurface(ps1, sizeof(ps1) / sizeof(ps1[0]), 1, &ierr);
  gmshModelAddPhysicalGroup(0, pg1, sizeof(pg1) / sizeof(pg1[0]), 1, &ierr);
  gmshModelAddPhysicalGroup(1, pg2, sizeof(pg2) / sizeof(pg2[0]), 2, &ierr);
  gmshModelAddPhysicalGroup(2, pg6, sizeof(pg6) / sizeof(pg6[0]), 6, &ierr);
  gmshModelSetPhysicalName(2, 6, "My surface", &ierr);
  gmshModelGeoSynchronize(&ierr);
  gmshModelMeshGenerate(2, &ierr);
  gmshWrite("t1.msh", &ierr);
  gmshFinalize(&ierr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xe22(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    0xe26(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe23(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe21(%rip),%eax
mov    %eax,-0x34(%rbp)
mov    0xdff(%rip),%rax
mov    %rax,-0x3c(%rbp)
mov    0xdf4(%rip),%rax
mov    %rax,-0x44(%rbp)
mov    0xe02(%rip),%eax
mov    %eax,-0x48(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
lea    -0x14(%rbp),%rcx
call   10f0 <gmshInitialize@plt>
lea    0xde7(%rip),%rdi
mov    $0x1,%esi
lea    -0x14(%rbp),%rdx
call   1060 <gmshOptionSetNumber@plt>
lea    0xde3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   10e0 <gmshModelAdd@plt>
movsd  -0x20(%rbp),%xmm2
xorps  %xmm1,%xmm1
xor    %edi,%edi
mov    $0x1,%esi
lea    -0x14(%rbp),%rdx
movaps %xmm1,%xmm0
call   1050 <gmshModelGeoAddPoint@plt>
movsd  -0x20(%rbp),%xmm2
movsd  0xd75(%rip),%xmm0
xorps  %xmm1,%xmm1
xor    %edi,%edi
mov    $0x2,%esi
lea    -0x14(%rbp),%rdx
call   1050 <gmshModelGeoAddPoint@plt>
movsd  -0x20(%rbp),%xmm2
movsd  0xd55(%rip),%xmm0
movsd  0xd45(%rip),%xmm1
xor    %edi,%edi
mov    $0x3,%esi
lea    -0x14(%rbp),%rdx
call   1050 <gmshModelGeoAddPoint@plt>
movsd  -0x20(%rbp),%xmm2
xorps  %xmm0,%xmm0
movsd  0xd25(%rip),%xmm1
xor    %edi,%edi
mov    $0x4,%esi
lea    -0x14(%rbp),%rdx
call   1050 <gmshModelGeoAddPoint@plt>
mov    $0x1,%edx
mov    $0x2,%esi
lea    -0x14(%rbp),%rcx
mov    %edx,%edi
call   1080 <gmshModelGeoAddLine@plt>
mov    $0x3,%edi
mov    $0x2,%edx
lea    -0x14(%rbp),%rcx
mov    %edx,%esi
call   1080 <gmshModelGeoAddLine@plt>
mov    $0x3,%edx
mov    $0x4,%esi
lea    -0x14(%rbp),%rcx
mov    %edx,%edi
call   1080 <gmshModelGeoAddLine@plt>
mov    $0x4,%edx
mov    $0x1,%esi
lea    -0x14(%rbp),%rcx
mov    %edx,%edi
call   1080 <gmshModelGeoAddLine@plt>
lea    -0x30(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
lea    -0x14(%rbp),%rcx
call   1030 <gmshModelGeoAddCurveLoop@plt>
lea    -0x34(%rbp),%rdi
mov    $0x1,%edx
lea    -0x14(%rbp),%rcx
mov    %edx,%esi
call   10b0 <gmshModelGeoAddPlaneSurface@plt>
lea    -0x3c(%rbp),%rsi
xor    %edi,%edi
mov    $0x2,%edx
mov    $0x1,%ecx
lea    -0x14(%rbp),%r8
call   1070 <gmshModelAddPhysicalGroup@plt>
lea    -0x44(%rbp),%rsi
mov    $0x1,%edi
mov    $0x2,%ecx
lea    -0x14(%rbp),%r8
mov    %ecx,%edx
call   1070 <gmshModelAddPhysicalGroup@plt>
lea    -0x48(%rbp),%rsi
mov    $0x2,%edi
mov    $0x1,%edx
mov    $0x6,%ecx
lea    -0x14(%rbp),%r8
call   1070 <gmshModelAddPhysicalGroup@plt>
mov    $0x2,%edi
mov    $0x6,%esi
lea    0xc7f(%rip),%rdx
lea    -0x14(%rbp),%rcx
call   10d0 <gmshModelSetPhysicalName@plt>
lea    -0x14(%rbp),%rdi
call   1090 <gmshModelGeoSynchronize@plt>
mov    $0x2,%edi
lea    -0x14(%rbp),%rsi
call   10a0 <gmshModelMeshGenerate@plt>
lea    0xc63(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <gmshWrite@plt>
lea    -0x14(%rbp),%rdi
call   10c0 <gmshFinalize@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xe44(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movl   $0x1,0x4(%rsp)
movabs $0x200000001,%rax
mov    %rax,0x10(%rsp)
mov    %rax,0x8(%rsp)
movl   $0x1,(%rsp)
lea    0x1c(%rsp),%rbx
mov    $0x1,%edx
mov    %rbx,%rcx
call   10f0 <gmshInitialize@plt>
lea    0xe13(%rip),%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1060 <gmshOptionSetNumber@plt>
lea    0xe10(%rip),%rdi
mov    %rbx,%rsi
call   10e0 <gmshModelAdd@plt>
movsd  0xdbf(%rip),%xmm2
xorps  %xmm0,%xmm0
xorps  %xmm1,%xmm1
xor    %edi,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
call   1050 <gmshModelGeoAddPoint@plt>
movsd  0xdaa(%rip),%xmm0
xorps  %xmm1,%xmm1
xor    %edi,%edi
movsd  0xd95(%rip),%xmm2
mov    $0x2,%esi
mov    %rbx,%rdx
call   1050 <gmshModelGeoAddPoint@plt>
movsd  0xd90(%rip),%xmm1
movsd  0xd80(%rip),%xmm0
xor    %edi,%edi
movsd  0xd6e(%rip),%xmm2
mov    $0x3,%esi
mov    %rbx,%rdx
call   1050 <gmshModelGeoAddPoint@plt>
xorps  %xmm0,%xmm0
movsd  0xd66(%rip),%xmm1
xor    %edi,%edi
movsd  0xd4c(%rip),%xmm2
mov    $0x4,%esi
mov    %rbx,%rdx
call   1050 <gmshModelGeoAddPoint@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <gmshModelGeoAddLine@plt>
mov    $0x3,%edi
mov    $0x2,%esi
mov    $0x2,%edx
mov    %rbx,%rcx
call   1080 <gmshModelGeoAddLine@plt>
mov    $0x3,%edi
mov    $0x4,%esi
mov    $0x3,%edx
mov    %rbx,%rcx
call   1080 <gmshModelGeoAddLine@plt>
mov    $0x4,%edi
mov    $0x1,%esi
mov    $0x4,%edx
mov    %rbx,%rcx
call   1080 <gmshModelGeoAddLine@plt>
lea    0x20(%rsp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1030 <gmshModelGeoAddCurveLoop@plt>
lea    0x4(%rsp),%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   10b0 <gmshModelGeoAddPlaneSurface@plt>
lea    0x10(%rsp),%rsi
xor    %edi,%edi
mov    $0x2,%edx
mov    $0x1,%ecx
mov    %rbx,%r8
call   1070 <gmshModelAddPhysicalGroup@plt>
lea    0x8(%rsp),%rsi
mov    $0x1,%edi
mov    $0x2,%edx
mov    $0x2,%ecx
mov    %rbx,%r8
call   1070 <gmshModelAddPhysicalGroup@plt>
mov    %rsp,%rsi
mov    $0x2,%edi
mov    $0x1,%edx
mov    $0x6,%ecx
mov    %rbx,%r8
call   1070 <gmshModelAddPhysicalGroup@plt>
lea    0xca3(%rip),%rdx
mov    $0x2,%edi
mov    $0x6,%esi
mov    %rbx,%rcx
call   10d0 <gmshModelSetPhysicalName@plt>
mov    %rbx,%rdi
call   1090 <gmshModelGeoSynchronize@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
call   10a0 <gmshModelMeshGenerate@plt>
lea    0xc80(%rip),%rdi
mov    %rbx,%rsi
call   1040 <gmshWrite@plt>
mov    %rbx,%rdi
call   10c0 <gmshFinalize@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.cl1 = [4 x i32] [i32 4, i32 1, i32 -2, i32 3]
@__const.main.ps1 = [1 x i32] [i32 1]
@__const.main.pg1 = [2 x i32] [i32 1, i32 2]
@__const.main.pg2 = [2 x i32] [i32 1, i32 2]
@__const.main.pg6 = [1 x i32] [i32 1]
@.str = [17 x i8] c"General.Terminal\00"
@.str.1 = [3 x i8] c"t1\00"
@.str.2 = [11 x i8] c"My surface\00"
@.str.3 = [7 x i8] c"t1.msh\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca double
%8 = alloca [4 x i32]
%9 = alloca [1 x i32]
%10 = alloca [2 x i32]
%11 = alloca [2 x i32]
%12 = alloca [1 x i32]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 1.000000e-02, double* %7
%13 = bitcast [4 x i32]* %8 to i8*
%14 = bitcast [1 x i32]* %9 to i8*
%15 = bitcast [2 x i32]* %10 to i8*
%16 = bitcast [2 x i32]* %11 to i8*
%17 = bitcast [1 x i32]* %12 to i8*
%18 = load i32, i32* %4
%19 = load i8**, i8*** %5
%20 = call i32 @gmshInitialize(i32 %18, i8** %19, i32 1, i32* %6)
%21 = call i32 @gmshOptionSetNumber(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1, i32* %6)
%22 = call i32 @gmshModelAdd(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%23 = load double, double* %7
%24 = call i32 @gmshModelGeoAddPoint(double 0.000000e+00, double 0.000000e+00, i32 0, double %23, i32 1, i32* %6)
%25 = load double, double* %7
%26 = call i32 @gmshModelGeoAddPoint(double 1.000000e-01, double 0.000000e+00, i32 0, double %25, i32 2, i32* %6)
%27 = load double, double* %7
%28 = call i32 @gmshModelGeoAddPoint(double 1.000000e-01, double 3.000000e-01, i32 0, double %27, i32 3, i32* %6)
%29 = load double, double* %7
%30 = call i32 @gmshModelGeoAddPoint(double 0.000000e+00, double 3.000000e-01, i32 0, double %29, i32 4, i32* %6)
%31 = call i32 @gmshModelGeoAddLine(i32 1, i32 2, i32 1, i32* %6)
%32 = call i32 @gmshModelGeoAddLine(i32 3, i32 2, i32 2, i32* %6)
%33 = call i32 @gmshModelGeoAddLine(i32 3, i32 4, i32 3, i32* %6)
%34 = call i32 @gmshModelGeoAddLine(i32 4, i32 1, i32 4, i32* %6)
%35 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 0
%36 = call i32 @gmshModelGeoAddCurveLoop(i32* %35, i32 4, i32 1, i32* %6)
%37 = getelementptr inbounds [1 x i32], [1 x i32]* %9, i64 0, i64 0
%38 = call i32 @gmshModelGeoAddPlaneSurface(i32* %37, i32 1, i32 1, i32* %6)
%39 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 0
%40 = call i32 @gmshModelAddPhysicalGroup(i32 0, i32* %39, i32 2, i32 1, i32* %6)
%41 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%42 = call i32 @gmshModelAddPhysicalGroup(i32 1, i32* %41, i32 2, i32 2, i32* %6)
%43 = getelementptr inbounds [1 x i32], [1 x i32]* %12, i64 0, i64 0
%44 = call i32 @gmshModelAddPhysicalGroup(i32 2, i32* %43, i32 1, i32 6, i32* %6)
%45 = call i32 @gmshModelSetPhysicalName(i32 2, i32 6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%46 = call i32 @gmshModelGeoSynchronize(i32* %6)
%47 = call i32 @gmshModelMeshGenerate(i32 2, i32* %6)
%48 = call i32 @gmshWrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%49 = call i32 @gmshFinalize(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@__const.main.cl1 = [4 x i32] [i32 4, i32 1, i32 -2, i32 3]
@.str = [17 x i8] c"General.Terminal\00"
@.str.1 = [3 x i8] c"t1\00"
@.str.2 = [11 x i8] c"My surface\00"
@.str.3 = [7 x i8] c"t1.msh\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca [4 x i32]
%5 = alloca [1 x i32]
%6 = alloca i64
%7 = alloca i64
%8 = alloca [1 x i32]
%9 = bitcast i32* %3 to i8*
%10 = bitcast [4 x i32]* %4 to i8*
%11 = bitcast [1 x i32]* %5 to i8*
%12 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 1, i32* %12
%13 = bitcast i64* %6 to i8*
store i64 8589934593, i64* %6
%14 = bitcast i64* %7 to i8*
store i64 8589934593, i64* %7
%15 = bitcast [1 x i32]* %8 to i8*
%16 = getelementptr inbounds [1 x i32], [1 x i32]* %8, i64 0, i64 0
store i32 1, i32* %16
%17 = call i32 @gmshInitialize(i32 %0, i8** %1, i32 1, i32* %3)
%18 = call i32 @gmshOptionSetNumber(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1, i32* %3)
%19 = call i32 @gmshModelAdd(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%20 = call i32 @gmshModelGeoAddPoint(double 0.000000e+00, double 0.000000e+00, i32 0, double 1.000000e-02, i32 1, i32* %3)
%21 = call i32 @gmshModelGeoAddPoint(double 1.000000e-01, double 0.000000e+00, i32 0, double 1.000000e-02, i32 2, i32* %3)
%22 = call i32 @gmshModelGeoAddPoint(double 1.000000e-01, double 3.000000e-01, i32 0, double 1.000000e-02, i32 3, i32* %3)
%23 = call i32 @gmshModelGeoAddPoint(double 0.000000e+00, double 3.000000e-01, i32 0, double 1.000000e-02, i32 4, i32* %3)
%24 = call i32 @gmshModelGeoAddLine(i32 1, i32 2, i32 1, i32* %3)
%25 = call i32 @gmshModelGeoAddLine(i32 3, i32 2, i32 2, i32* %3)
%26 = call i32 @gmshModelGeoAddLine(i32 3, i32 4, i32 3, i32* %3)
%27 = call i32 @gmshModelGeoAddLine(i32 4, i32 1, i32 4, i32* %3)
%28 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%29 = call i32 @gmshModelGeoAddCurveLoop(i32* %28, i32 4, i32 1, i32* %3)
%30 = call i32 @gmshModelGeoAddPlaneSurface(i32* %12, i32 1, i32 1, i32* %3)
%31 = bitcast i64* %6 to i32*
%32 = call i32 @gmshModelAddPhysicalGroup(i32 0, i32* %31, i32 2, i32 1, i32* %3)
%33 = bitcast i64* %7 to i32*
%34 = call i32 @gmshModelAddPhysicalGroup(i32 1, i32* %33, i32 2, i32 2, i32* %3)
%35 = call i32 @gmshModelAddPhysicalGroup(i32 2, i32* %16, i32 1, i32 6, i32* %3)
%36 = call i32 @gmshModelSetPhysicalName(i32 2, i32 6, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%37 = call i32 @gmshModelGeoSynchronize(i32* %3)
%38 = call i32 @gmshModelMeshGenerate(i32 2, i32* %3)
%39 = call i32 @gmshWrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%40 = call i32 @gmshFinalize(i32* %3)
ret i32 0
}