#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*/ _exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *,
                           unsigned long long, char *);
scalar_t__ newenv_env_(int, char *, char *);
int /*<<< orphan*/ stderr;
void test3(void) {
  for (;;) {
    if (newenv_env_(2, ("XXX"), ("YYY")))
      break;
  }
  if (!newenv_env_(1, ("XXX"), ("YYY")))
    do {
      fprintf(stderr, "%s:%llu: %s\n",
              ("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/heads/"
               "master/tinyssh-tests/newenvtest.c"),
              (unsigned long long)(114), (("newenv_env failure")));
      fflush(stderr);
      _exit(111);
    } while (0);
  ;
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
jmp    1149 <test3+0x9>
mov    $0x2,%edi
lea    0xeab(%rip),%rsi
lea    0xea8(%rip),%rdx
call   1060 <newenv_env_@plt>
cmp    $0x0,%rax
je     1170 <test3+0x30>
jmp    1175 <test3+0x35>
jmp    1149 <test3+0x9>
mov    $0x1,%edi
lea    0xe7f(%rip),%rsi
lea    0xe7c(%rip),%rdx
call   1060 <newenv_env_@plt>
cmp    $0x0,%rax
jne    11dc <test3+0x9c>
jmp    119c <test3+0x5c>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
lea    0xe5c(%rip),%rsi
lea    0xe62(%rip),%rdx
mov    $0x72,%ecx
lea    0xeef(%rip),%r8
call   1040 <fprintf@plt>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x6f,%edi
call   1030 <_exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
push   %r14
push   %rbx
push   %rax
lea    0xeb5(%rip),%r14
lea    0xeb2(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x2,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <newenv_env_@plt>
test   %rax,%rax
je     1160 <test3+0x20>
lea    0xe84(%rip),%rsi
lea    0xe81(%rip),%rdx
mov    $0x1,%edi
call   1060 <newenv_env_@plt>
test   %rax,%rax
je     119a <test3+0x5a>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2e3f(%rip),%rbx
mov    (%rbx),%edi
lea    0xe5e(%rip),%rsi
lea    0xe64(%rip),%rdx
lea    0xef6(%rip),%r8
mov    $0x72,%ecx
call   1040 <fprintf@plt>
mov    (%rbx),%edi
call   1050 <fflush@plt>
mov    $0x6f,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"XXX\00"
@.str.1 = [4 x i8] c"YYY\00"
@stderr = global i32 0
@.str.2 = [13 x i8] c"%s:%llu: %s\0A\00"
@.str.3 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/heads/master/tinyssh-tests/newenvtest.c\00"
@.str.4 = [19 x i8] c"newenv_env failure\00"
define void @test3() {
br label %1
1: ; preds = %5, %0
%2 = call i64 @newenv_env_(i32 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %6
5: ; preds = %1
br label %1
6: ; preds = %4
%7 = call i64 @newenv_env_(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp ne i64 %7, 0
br i1 %8, label %17, label %9
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.3, i64 0, i64 0), i64 114, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = call i32 @fflush(i32 %13)
%15 = call i32 @_exit(i32 111)
unreachable
16: ; No predecessors!
br label %17
17: ; preds = %16, %6
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"XXX\00"
@.str.1 = [4 x i8] c"YYY\00"
@stderr = global i32 0
@.str.2 = [13 x i8] c"%s:%llu: %s\0A\00"
@.str.3 = [153 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/janmojzis/tinyssh/refs/heads/master/tinyssh-tests/newenvtest.c\00"
@.str.4 = [19 x i8] c"newenv_env failure\00"
define void @test3() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 @newenv_env_(i32 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i64 @newenv_env_(i32 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([153 x i8], [153 x i8]* @.str.3, i64 0, i64 0), i64 114, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%10 = load i32, i32* @stderr
%11 = tail call i32 @fflush(i32 %10)
%12 = tail call i32 @_exit(i32 111)
unreachable
13: ; preds = %4
ret void
}