#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 *, ...);
int /*<<< orphan*/ pspw_molecule_data(int *, int *, int *, int *);
int /*<<< orphan*/ pspw_molecule_end();
int /*<<< orphan*/ pspw_molecule_read(char *);
int pspw_molecule_size();
main() {
  int m, m1, msize;
  int i, asize, indx[50], cyclic;
  pspw_molecule_read("MOLECULE");
  msize = pspw_molecule_size();
  printf("msize: %d\n\n", msize);
  for (m = 1; m <= msize; ++m) {
    pspw_molecule_data(&m, &asize, indx, &cyclic);
    printf("asize: %d\n", asize);
    for (i = 0; i < asize; ++i)
      printf("%d ", indx[i]);
    if (cyclic)
      printf("c\n");
    else
      printf("l\n");
  }
  pspw_molecule_end();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
call   1060 <pspw_molecule_read@plt>
mov    $0x0,%al
call   1040 <pspw_molecule_size@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1243 <main+0xf3>
lea    -0xe0(%rbp),%rdx
lea    -0x8(%rbp),%rdi
lea    -0x18(%rbp),%rsi
lea    -0xe4(%rbp),%rcx
call   1070 <pspw_molecule_data@plt>
mov    -0x18(%rbp),%esi
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1202 <main+0xb2>
movslq -0x14(%rbp),%rax
mov    -0xe0(%rbp,%rax,4),%esi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11cf <main+0x7f>
cmpl   $0x0,-0xe4(%rbp)
je     1222 <main+0xd2>
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1230 <main+0xe0>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1235 <main+0xe5>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1190 <main+0x40>
mov    $0x0,%al
call   1030 <pspw_molecule_end@plt>
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
lea    0xe88(%rip),%rdi
call   1070 <pspw_molecule_read@plt>
xor    %eax,%eax
call   1050 <pspw_molecule_size@plt>
mov    %eax,%ebx
lea    0xe7c(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movl   $0x1,0x8(%rsp)
test   %ebx,%ebx
jle    124f <main+0xef>
lea    0xe68(%rip),%rbp
lea    0xe6c(%rip),%r14
lea    0xe69(%rip),%r15
lea    0xe64(%rip),%r12
jmp    11f0 <main+0x90>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpl   $0x0,0xc(%rsp)
mov    %r12,%rdi
cmove  %r15,%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x8(%rsp)
cmp    %ebx,%eax
jge    124f <main+0xef>
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1080 <pspw_molecule_data@plt>
mov    0x4(%rsp),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11d0 <main+0x70>
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp,%r13,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%r13
movslq 0x4(%rsp),%rax
cmp    %rax,%r13
jl     1230 <main+0xd0>
jmp    11d0 <main+0x70>
xor    %eax,%eax
call   1030 <pspw_molecule_end@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"MOLECULE\00"
@.str.1 = [12 x i8] c"msize: %d\0A\0A\00"
@.str.2 = [11 x i8] c"asize: %d\0A\00"
@.str.3 = [4 x i8] c"%d \00"
@.str.4 = [3 x i8] c"c\0A\00"
@.str.5 = [3 x i8] c"l\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [50 x i32]
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 @pspw_molecule_read(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @pspw_molecule_size()
store i32 %10, i32* %4
%11 = load i32, i32* %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %11)
store i32 1, i32* %2
br label %13
13: ; preds = %43, %0
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %46
17: ; preds = %13
%18 = getelementptr inbounds [50 x i32], [50 x i32]* %7, i64 0, i64 0
%19 = call i32 @pspw_molecule_data(i32* %2, i32* %6, i32* %18, i32* %8)
%20 = load i32, i32* %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %20)
store i32 0, i32* %5
br label %22
22: ; preds = %32, %17
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %35
26: ; preds = %22
%27 = load i32, i32* %5
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [50 x i32], [50 x i32]* %7, i64 0, i64 %28
%30 = load i32, i32* %29
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %26
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %22
35: ; preds = %22
%36 = load i32, i32* %8
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %40
38: ; preds = %35
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
br label %42
40: ; preds = %35
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %42
42: ; preds = %40, %38
br label %43
43: ; preds = %42
%44 = load i32, i32* %2
%45 = add nsw i32 %44, 1
store i32 %45, i32* %2
br label %13
46: ; preds = %13
%47 = call i32 (...) @pspw_molecule_end()
%48 = load i32, i32* %1
ret i32 %48
}

LLVM IR (-O2):
@.str = [9 x i8] c"MOLECULE\00"
@.str.1 = [12 x i8] c"msize: %d\0A\0A\00"
@.str.2 = [11 x i8] c"asize: %d\0A\00"
@.str.3 = [4 x i8] c"%d \00"
@str = [2 x i8] c"l\00"
@str.6 = [2 x i8] c"c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [50 x i32]
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast [50 x i32]* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = tail call i32 @pspw_molecule_read(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 (...) @pspw_molecule_size()
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %10)
store i32 1, i32* %1
%12 = icmp slt i32 %10, 1
br i1 %12, label %38, label %13
13: ; preds = %0
%14 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 0
br label %15
15: ; preds = %13, %30
%16 = call i32 @pspw_molecule_data(i32* %1, i32* %2, i32* %14, i32* %4)
%17 = load i32, i32* %2
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %2
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %15, %21
%22 = phi i64 [ %26, %21 ], [ 0, %15 ]
%23 = getelementptr inbounds [50 x i32], [50 x i32]* %3, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %24)
%26 = add nuw nsw i64 %22, 1
%27 = load i32, i32* %2
%28 = sext i32 %27 to i64
%29 = icmp slt i64 %26, %28
br i1 %29, label %21, label %30
30: ; preds = %21, %15
%31 = load i32, i32* %4
%32 = icmp eq i32 %31, 0
%33 = select i1 %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @str.6, i64 0, i64 0)
%34 = call i32 @puts(i8* dereferenceable(1) %33)
%35 = load i32, i32* %1
%36 = add nsw i32 %35, 1
store i32 %36, i32* %1
%37 = icmp slt i32 %35, %10
br i1 %37, label %15, label %38
38: ; preds = %30, %0
%39 = call i32 (...) @pspw_molecule_end()
ret i32 0
}