#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 */
char *cnfCreim(char *const, int);
int /*<<< orphan*/ cnfFree(char *);
int /*<<< orphan*/ emsRep(char *, char *, int *const);
int /*<<< orphan*/ emsSetc(char *, char *);
int /*<<< orphan*/ hdsTune(char *, int, int *const);
int /*<<< orphan*/ printf(char *);
scalar_t__ strncmp(char *, char *, int);
void dat_tune_(char *const name, int *const value, int *const status,
               int name_length) {
  char *name_c;
  if (*status != 0)
    return;
  printf("DAT_TUNE is obsoleted by HDS_TUNE\n");
  name_c = cnfCreim(name, name_length);
  if (strncmp(name_c, "NCOMP", 5) == 0) {
    hdsTune(name_c, *value, status);
  } else {
    emsSetc("NM", name_c);
    emsRep("DAT_TUNE_ERR", "Unrecognized tuning parameter (^NM)", status);
  }
  cnfFree(name_c);
}


x86 assembly (clang, -O0):
<dat_tune_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
cmpl   $0x0,(%rax)
je     1199 <dat_tune_+0x29>
jmp    121c <dat_tune_+0xac>
lea    0xe60(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1090 <cnfCreim@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe63(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11ec <dat_tune_+0x7c>
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rdx
call   1070 <hdsTune@plt>
jmp    1213 <dat_tune_+0xa3>
mov    -0x28(%rbp),%rsi
lea    0xe32(%rip),%rdi
call   1060 <emsSetc@plt>
mov    -0x18(%rbp),%rdx
lea    0xe25(%rip),%rdi
lea    0xe2b(%rip),%rsi
call   1080 <emsRep@plt>
mov    -0x28(%rbp),%rdi
call   1040 <cnfFree@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dat_tune_>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmpl   $0x0,(%rdx)
je     1186 <dat_tune_+0x16>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ecx,%ebp
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0xea2(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1090 <cnfCreim@plt>
mov    %rax,%r14
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     11ea <dat_tune_+0x7a>
lea    0xe3c(%rip),%rdi
mov    %r14,%rsi
call   1060 <emsSetc@plt>
lea    0xe30(%rip),%rdi
lea    0xe36(%rip),%rsi
mov    %r12,%rdx
call   1080 <emsRep@plt>
jmp    11f8 <dat_tune_+0x88>
mov    (%r15),%esi
mov    %r14,%rdi
mov    %r12,%rdx
call   1070 <hdsTune@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <cnfFree@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"DAT_TUNE is obsoleted by HDS_TUNE\0A\00"
@.str.1 = [6 x i8] c"NCOMP\00"
@.str.2 = [3 x i8] c"NM\00"
@.str.3 = [13 x i8] c"DAT_TUNE_ERR\00"
@.str.4 = [36 x i8] c"Unrecognized tuning parameter (^NM)\00"
define void @dat_tune_(i8* %0, i32* %1, i32* %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%10 = load i32*, i32** %7
%11 = load i32, i32* %10
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %4
br label %36
14: ; preds = %4
%15 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%16 = load i8*, i8** %5
%17 = load i32, i32* %8
%18 = call i8* @cnfCreim(i8* %16, i32 %17)
store i8* %18, i8** %9
%19 = load i8*, i8** %9
%20 = call i64 @strncmp(i8* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%21 = icmp eq i64 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %14
%23 = load i8*, i8** %9
%24 = load i32*, i32** %6
%25 = load i32, i32* %24
%26 = load i32*, i32** %7
%27 = call i32 @hdsTune(i8* %23, i32 %25, i32* %26)
br label %33
28: ; preds = %14
%29 = load i8*, i8** %9
%30 = call i32 @emsSetc(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %29)
%31 = load i32*, i32** %7
%32 = call i32 @emsRep(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32* %31)
br label %33
33: ; preds = %28, %22
%34 = load i8*, i8** %9
%35 = call i32 @cnfFree(i8* %34)
br label %36
36: ; preds = %33, %13
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"NCOMP\00"
@.str.2 = [3 x i8] c"NM\00"
@.str.3 = [13 x i8] c"DAT_TUNE_ERR\00"
@.str.4 = [36 x i8] c"Unrecognized tuning parameter (^NM)\00"
@str = [34 x i8] c"DAT_TUNE is obsoleted by HDS_TUNE\00"
define void @dat_tune_(i8* %0, i32* nocapture %1, i32* %2, i32 %3) {
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%9 = tail call i8* @cnfCreim(i8* %0, i32 %3)
%10 = tail call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 5)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load i32, i32* %1
%14 = tail call i32 @hdsTune(i8* %9, i32 %13, i32* %2)
br label %18
15: ; preds = %7
%16 = tail call i32 @emsSetc(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %9)
%17 = tail call i32 @emsRep(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32* %2)
br label %18
18: ; preds = %15, %12
%19 = tail call i32 @cnfFree(i8* %9)
br label %20
20: ; preds = %4, %18
ret void
}