#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*/ CHECK(int, char *);
int nc_close(int);
int nc_open(char *, int /*<<< orphan*/, int *);
int /*<<< orphan*/ printf(char *);
int main() {
  int ncid, retval;
  printf("Testing: Http Basic Authorization\n");
  retval = nc_open("http://tiggeUser:tigge@thredds-test.ucar.edu/thredds/dodsC/"
                   "restrict/testData.nc",
                   0, &ncid);
  CHECK(retval, "*** Fail: Http Basic Authorization");
  retval = nc_close(ncid);
  printf("*** PASS: Http Basic Authorization\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1050 <printf@plt>
lea    0xec1(%rip),%rdi
xor    %esi,%esi
lea    -0x8(%rbp),%rdx
call   1060 <nc_open@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0xef9(%rip),%rsi
call   1030 <CHECK@plt>
mov    -0x8(%rbp),%edi
call   1040 <nc_close@plt>
mov    %eax,-0xc(%rbp)
lea    0xf05(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf2b(%rip),%rdi
call   1040 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0x4(%rsp),%rdx
xor    %esi,%esi
call   1060 <nc_open@plt>
lea    0xee9(%rip),%rsi
mov    %eax,%edi
call   1030 <CHECK@plt>
mov    0x4(%rsp),%edi
call   1050 <nc_close@plt>
lea    0xf17(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Testing: Http Basic Authorization\0A\00"
@.str.1 = [80 x i8] c"http://tiggeUser:tigge@thredds-test.ucar.edu/thredds/dodsC/restrict/testData.nc\00"
@.str.2 = [35 x i8] c"*** Fail: Http Basic Authorization\00"
@.str.3 = [36 x i8] c"*** PASS: Http Basic Authorization\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @nc_open(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0), i32 0, i32* %2)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @CHECK(i32 %6, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = call i32 @nc_close(i32 %8)
store i32 %9, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [80 x i8] c"http://tiggeUser:tigge@thredds-test.ucar.edu/thredds/dodsC/restrict/testData.nc\00"
@.str.2 = [35 x i8] c"*** Fail: Http Basic Authorization\00"
@str = [34 x i8] c"Testing: Http Basic Authorization\00"
@str.4 = [35 x i8] c"*** PASS: Http Basic Authorization\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%4 = call i32 @nc_open(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.1, i64 0, i64 0), i32 0, i32* %1)
%5 = call i32 @CHECK(i32 %4, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%6 = load i32, i32* %1
%7 = call i32 @nc_close(i32 %6)
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}