#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ nid;
};
typedef TYPE_1__ EC_builtin_curve;

/* Variables and functions */
char *OBJ_nid2sn(int /*<<< orphan*/);
scalar_t__ printf(char *, char *, char const *, char const *);
bool print_curve(void *misc, EC_builtin_curve *curve, int digest,
                 const char *oid, const char *m, const char *n) {
  if (printf("%s,%s,M,%s\n", OBJ_nid2sn(curve->nid), oid, m) < 0)
    return false;
  if (printf("%s,%s,N,%s\n", OBJ_nid2sn(curve->nid), oid, n) < 0)
    return false;
  return true;
}


x86 assembly (clang, -O0):
<print_curve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1030 <OBJ_nid2sn@plt>
mov    %rax,%rsi
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
cmp    $0x0,%rax
jge    1177 <print_curve+0x57>
movl   $0x0,-0x4(%rbp)
jmp    11b6 <print_curve+0x96>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1030 <OBJ_nid2sn@plt>
mov    %rax,%rsi
mov    -0x28(%rbp),%rdx
mov    -0x38(%rbp),%rcx
lea    0xe78(%rip),%rdi
call   1040 <printf@plt>
cmp    $0x0,%rax
jge    11af <print_curve+0x8f>
movl   $0x0,-0x4(%rbp)
jmp    11b6 <print_curve+0x96>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_curve>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r12
mov    %rcx,%r15
mov    %rsi,%rbx
mov    (%rsi),%edi
call   1030 <OBJ_nid2sn@plt>
lea    0xebe(%rip),%rdi
mov    %rax,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
call   1040 <printf@plt>
test   %rax,%rax
js     117a <print_curve+0x5a>
mov    (%rbx),%edi
call   1030 <OBJ_nid2sn@plt>
lea    0xea9(%rip),%rdi
mov    %rax,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <printf@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
jmp    117c <print_curve+0x5c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
@.str = [12 x i8] c"%s,%s,M,%s\0A\00"
@.str.1 = [12 x i8] c"%s,%s,N,%s\0A\00"
define i32 @print_curve(i8* %0, %struct.TYPE_3__* %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca %struct.TYPE_3__*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
store i8* %0, i8** %8
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%14 = load %struct.TYPE_3__*, %struct.TYPE_3__** %9
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = call i8* @OBJ_nid2sn(i32 %16)
%18 = load i8*, i8** %11
%19 = load i8*, i8** %12
%20 = call i64 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %17, i8* %18, i8* %19)
%21 = icmp slt i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %6
store i32 0, i32* %7
br label %34
23: ; preds = %6
%24 = load %struct.TYPE_3__*, %struct.TYPE_3__** %9
%25 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %24, i32 0, i32 0
%26 = load i32, i32* %25
%27 = call i8* @OBJ_nid2sn(i32 %26)
%28 = load i8*, i8** %11
%29 = load i8*, i8** %13
%30 = call i64 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %27, i8* %28, i8* %29)
%31 = icmp slt i64 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %23
store i32 0, i32* %7
br label %34
33: ; preds = %23
store i32 1, i32* %7
br label %34
34: ; preds = %33, %32, %22
%35 = load i32, i32* %7
ret i32 %35
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
@.str = [12 x i8] c"%s,%s,M,%s\0A\00"
@.str.1 = [12 x i8] c"%s,%s,N,%s\0A\00"
define i32 @print_curve(i8* nocapture readnone %0, %struct.TYPE_3__* nocapture %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%8 = load i32, i32* %7
%9 = tail call i8* @OBJ_nid2sn(i32 %8)
%10 = tail call i64 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %3, i8* %4)
%11 = icmp slt i64 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %6
%13 = load i32, i32* %7
%14 = tail call i8* @OBJ_nid2sn(i32 %13)
%15 = tail call i64 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %14, i8* %3, i8* %5)
%16 = lshr i64 %15, 63
%17 = trunc i64 %16 to i32
%18 = xor i32 %17, 1
br label %19
19: ; preds = %12, %6
%20 = phi i32 [ 0, %6 ], [ %18, %12 ]
ret i32 %20
}