#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 _ada_use_c2phc(int, int *, int *, double *);
int read_dobldobl_witness_set_from_file(int m, char *s, int *n, int *dim,
                                        int *deg) {
  int b[m], i, fail;
  double *c;
  for (i = 0; i < m; i++)
    b[i] = (int)s[i];
  *n = m;
  fail = _ada_use_c2phc(654, n, b, c);
  *dim = b[0];
  *deg = b[1];
  return fail;
}


x86 assembly (clang, -O0):
<read_dobldobl_witness_set_from_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x50(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    118a <read_dobldobl_witness_set_from_file+0x7a>
mov    -0x50(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x3c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%edx
movslq -0x3c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1159 <read_dobldobl_witness_set_from_file+0x49>
mov    -0x50(%rbp),%rdx
mov    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rsi
mov    -0x48(%rbp),%rcx
mov    $0x28e,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,-0x40(%rbp)
mov    (%rax),%edx
mov    -0x20(%rbp),%rcx
mov    %edx,(%rcx)
mov    0x4(%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x40(%rbp),%eax
mov    -0x30(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_dobldobl_witness_set_from_file>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %edi,%r8d
mov    %rsp,%r12
lea    0xf(,%r8,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
test   %edi,%edi
jle    1241 <read_dobldobl_witness_set_from_file+0x131>
cmp    $0x8,%edi
jae    114d <read_dobldobl_witness_set_from_file+0x3d>
xor    %ecx,%ecx
jmp    1230 <read_dobldobl_witness_set_from_file+0x120>
mov    %r8d,%ecx
and    $0xfffffff8,%ecx
lea    -0x8(%rcx),%rax
mov    %rax,%r9
shr    $0x3,%r9
add    $0x1,%r9
test   %rax,%rax
je     126f <read_dobldobl_witness_set_from_file+0x15f>
mov    %r9,%rbx
and    $0xfffffffffffffffe,%rbx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movd   (%rsi,%rax,1),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
movd   0x4(%rsi,%rax,1),%xmm1
punpcklbw %xmm1,%xmm1
punpcklwd %xmm1,%xmm1
psrad  $0x18,%xmm0
psrad  $0x18,%xmm1
movdqa %xmm0,(%r12,%rax,4)
movdqa %xmm1,0x10(%r12,%rax,4)
movd   0x8(%rsi,%rax,1),%xmm0
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
movd   0xc(%rsi,%rax,1),%xmm1
punpcklbw %xmm1,%xmm1
punpcklwd %xmm1,%xmm1
psrad  $0x18,%xmm0
psrad  $0x18,%xmm1
movdqa %xmm0,0x20(%r12,%rax,4)
movdqa %xmm1,0x30(%r12,%rax,4)
add    $0x10,%rax
add    $0xfffffffffffffffe,%rbx
jne    1180 <read_dobldobl_witness_set_from_file+0x70>
test   $0x1,%r9b
je     1228 <read_dobldobl_witness_set_from_file+0x118>
movd   (%rsi,%rax,1),%xmm0
movd   0x4(%rsi,%rax,1),%xmm1
punpcklbw %xmm0,%xmm0
punpcklwd %xmm0,%xmm0
psrad  $0x18,%xmm0
punpcklbw %xmm1,%xmm1
punpcklwd %xmm1,%xmm1
psrad  $0x18,%xmm1
movdqa %xmm0,(%r12,%rax,4)
movdqa %xmm1,0x10(%r12,%rax,4)
cmp    %r8,%rcx
je     1241 <read_dobldobl_witness_set_from_file+0x131>
nopl   (%rax)
movsbl (%rsi,%rcx,1),%eax
mov    %eax,(%r12,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%r8
jne    1230 <read_dobldobl_witness_set_from_file+0x120>
mov    %edi,(%rdx)
mov    $0x28e,%edi
mov    %rdx,%rsi
mov    %r12,%rdx
call   1030 <_ada_use_c2phc@plt>
mov    (%r12),%ecx
mov    %ecx,(%r15)
mov    0x4(%r12),%ecx
mov    %ecx,(%r14)
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
test   $0x1,%r9b
jne    11f6 <read_dobldobl_witness_set_from_file+0xe6>
jmp    1228 <read_dobldobl_witness_set_from_file+0x118>

LLVM IR (-O0):
define i32 @read_dobldobl_witness_set_from_file(i32 %0, i8* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i32
%14 = alloca i32
%15 = alloca double*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%16 = load i32, i32* %6
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %11
%19 = alloca i32, i64 %17
store i64 %17, i64* %12
store i32 0, i32* %13
br label %20
20: ; preds = %34, %5
%21 = load i32, i32* %13
%22 = load i32, i32* %6
%23 = icmp slt i32 %21, %22
br i1 %23, label %24, label %37
24: ; preds = %20
%25 = load i8*, i8** %7
%26 = load i32, i32* %13
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = sext i8 %29 to i32
%31 = load i32, i32* %13
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds i32, i32* %19, i64 %32
store i32 %30, i32* %33
br label %34
34: ; preds = %24
%35 = load i32, i32* %13
%36 = add nsw i32 %35, 1
store i32 %36, i32* %13
br label %20
37: ; preds = %20
%38 = load i32, i32* %6
%39 = load i32*, i32** %8
store i32 %38, i32* %39
%40 = load i32*, i32** %8
%41 = load double*, double** %15
%42 = call i32 @_ada_use_c2phc(i32 654, i32* %40, i32* %19, double* %41)
store i32 %42, i32* %14
%43 = getelementptr inbounds i32, i32* %19, i64 0
%44 = load i32, i32* %43
%45 = load i32*, i32** %9
store i32 %44, i32* %45
%46 = getelementptr inbounds i32, i32* %19, i64 1
%47 = load i32, i32* %46
%48 = load i32*, i32** %10
store i32 %47, i32* %48
%49 = load i32, i32* %14
%50 = load i8*, i8** %11
ret i32 %49
}

LLVM IR (-O2):
define i32 @read_dobldobl_witness_set_from_file(i32 %0, i8* nocapture %1, i32* %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = zext i32 %0 to i64
%7 = alloca i32, i64 %6
%8 = icmp sgt i32 %0, 0
br i1 %8, label %9, label %79
9: ; preds = %5
%10 = icmp ult i32 %0, 8
br i1 %10, label %69, label %11
11: ; preds = %9
%12 = and i64 %6, 4294967288
%13 = add nsw i64 %12, -8
%14 = lshr exact i64 %13, 3
%15 = add nuw nsw i64 %14, 1
%16 = and i64 %15, 1
%17 = icmp eq i64 %13, 0
br i1 %17, label %51, label %18
18: ; preds = %11
%19 = and i64 %15, 4611686018427387902
br label %20
20: ; preds = %20, %18
%21 = phi i64 [ 0, %18 ], [ %48, %20 ]
%22 = phi i64 [ 0, %18 ], [ %49, %20 ]
%23 = getelementptr inbounds i8, i8* %1, i64 %21
%24 = bitcast i8* %23 to <4 x i8>*
%25 = load <4 x i8>, <4 x i8>* %24
%26 = getelementptr inbounds i8, i8* %23, i64 4
%27 = bitcast i8* %26 to <4 x i8>*
%28 = load <4 x i8>, <4 x i8>* %27
%29 = sext <4 x i8> %25 to <4 x i32>
%30 = sext <4 x i8> %28 to <4 x i32>
%31 = getelementptr inbounds i32, i32* %7, i64 %21
%32 = bitcast i32* %31 to <4 x i32>*
store <4 x i32> %29, <4 x i32>* %32
%33 = getelementptr inbounds i32, i32* %31, i64 4
%34 = bitcast i32* %33 to <4 x i32>*
store <4 x i32> %30, <4 x i32>* %34
%35 = or i64 %21, 8
%36 = getelementptr inbounds i8, i8* %1, i64 %35
%37 = bitcast i8* %36 to <4 x i8>*
%38 = load <4 x i8>, <4 x i8>* %37
%39 = getelementptr inbounds i8, i8* %36, i64 4
%40 = bitcast i8* %39 to <4 x i8>*
%41 = load <4 x i8>, <4 x i8>* %40
%42 = sext <4 x i8> %38 to <4 x i32>
%43 = sext <4 x i8> %41 to <4 x i32>
%44 = getelementptr inbounds i32, i32* %7, i64 %35
%45 = bitcast i32* %44 to <4 x i32>*
store <4 x i32> %42, <4 x i32>* %45
%46 = getelementptr inbounds i32, i32* %44, i64 4
%47 = bitcast i32* %46 to <4 x i32>*
store <4 x i32> %43, <4 x i32>* %47
%48 = add nuw i64 %21, 16
%49 = add i64 %22, 2
%50 = icmp eq i64 %49, %19
br i1 %50, label %51, label %20
51: ; preds = %20, %11
%52 = phi i64 [ 0, %11 ], [ %48, %20 ]
%53 = icmp eq i64 %16, 0
br i1 %53, label %67, label %54
54: ; preds = %51
%55 = getelementptr inbounds i8, i8* %1, i64 %52
%56 = bitcast i8* %55 to <4 x i8>*
%57 = load <4 x i8>, <4 x i8>* %56
%58 = getelementptr inbounds i8, i8* %55, i64 4
%59 = bitcast i8* %58 to <4 x i8>*
%60 = load <4 x i8>, <4 x i8>* %59
%61 = sext <4 x i8> %57 to <4 x i32>
%62 = sext <4 x i8> %60 to <4 x i32>
%63 = getelementptr inbounds i32, i32* %7, i64 %52
%64 = bitcast i32* %63 to <4 x i32>*
store <4 x i32> %61, <4 x i32>* %64
%65 = getelementptr inbounds i32, i32* %63, i64 4
%66 = bitcast i32* %65 to <4 x i32>*
store <4 x i32> %62, <4 x i32>* %66
br label %67
67: ; preds = %51, %54
%68 = icmp eq i64 %12, %6
br i1 %68, label %79, label %69
69: ; preds = %9, %67
%70 = phi i64 [ 0, %9 ], [ %12, %67 ]
br label %71
71: ; preds = %69, %71
%72 = phi i64 [ %77, %71 ], [ %70, %69 ]
%73 = getelementptr inbounds i8, i8* %1, i64 %72
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = getelementptr inbounds i32, i32* %7, i64 %72
store i32 %75, i32* %76
%77 = add nuw nsw i64 %72, 1
%78 = icmp eq i64 %77, %6
br i1 %78, label %79, label %71
79: ; preds = %71, %67, %5
store i32 %0, i32* %2
%80 = call i32 @_ada_use_c2phc(i32 654, i32* %2, i32* %7, double* undef)
%81 = load i32, i32* %7
store i32 %81, i32* %3
%82 = getelementptr inbounds i32, i32* %7, i64 1
%83 = load i32, i32* %82
store i32 %83, i32* %4
ret i32 %80
}