#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ snprintf(char *, int const, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
void __ompc_print_env_tag(char *env_name) {
  int i, j;
  const int max_len = 36;
  char env_name_tag[max_len];
  snprintf(env_name_tag, max_len, "[%s]", env_name);
  j = strlen(env_name_tag);
  for (i = 0; i < (max_len - j); i++)
    strcat(env_name_tag, " ");
  fprintf(stderr, "%s", env_name_tag);
}


x86 assembly (clang, -O0):
<__ompc_print_env_tag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x24,-0x14(%rbp)
mov    %rsp,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rcx
lea    -0x50(%rbp),%rdi
mov    $0x24,%esi
lea    0xe92(%rip),%rdx
call   1040 <snprintf@plt>
lea    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x24,%ecx
sub    -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    11b7 <__ompc_print_env_tag+0x77>
lea    -0x50(%rbp),%rdi
lea    0xe61(%rip),%rsi
call   1060 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1186 <__ompc_print_env_tag+0x46>
mov    0x2e22(%rip),%rax
mov    (%rax),%edi
lea    0xe40(%rip),%rsi
lea    -0x50(%rbp),%rdx
call   1050 <fprintf@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ompc_print_env_tag>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rdi,%rcx
lea    0xeae(%rip),%rdx
mov    %rsp,%rbp
mov    $0x24,%ebx
mov    %rbp,%rdi
mov    $0x24,%esi
call   1040 <snprintf@plt>
mov    %rbp,%rdi
call   1030 <strlen@plt>
cmp    $0x23,%eax
jg     11a0 <__ompc_print_env_tag+0x60>
sub    %eax,%ebx
cmp    $0x2,%ebx
mov    $0x1,%ebp
cmovge %ebx,%ebp
lea    0xe7d(%rip),%r14
mov    %rsp,%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
add    $0xffffffff,%ebp
jne    1190 <__ompc_print_env_tag+0x50>
mov    0x2e39(%rip),%rax
mov    (%rax),%edi
lea    0xe57(%rip),%rsi
mov    %rsp,%rdx
call   1050 <fprintf@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"[%s]\00"
@.str.1 = [2 x i8] c" \00"
@stderr = global i32 0
@.str.2 = [3 x i8] c"%s\00"
define void @__ompc_print_env_tag(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %2
store i32 36, i32* %5
%7 = call i8* @llvm.stacksave()
store i8* %7, i8** %6
%8 = alloca i8, i64 36
%9 = load i8*, i8** %2
%10 = call i32 @snprintf(i8* %8, i32 36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = call i32 @strlen(i8* %8)
store i32 %11, i32* %4
store i32 0, i32* %3
br label %12
12: ; preds = %19, %1
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = sub nsw i32 36, %14
%16 = icmp slt i32 %13, %15
br i1 %16, label %17, label %22
17: ; preds = %12
%18 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %12
22: ; preds = %12
%23 = load i32, i32* @stderr
%24 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %8)
%25 = load i8*, i8** %6
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"[%s]\00"
@.str.1 = [2 x i8] c" \00"
@stderr = global i32 0
@.str.2 = [3 x i8] c"%s\00"
define void @__ompc_print_env_tag(i8* %0) {
%2 = alloca [36 x i8]
%3 = getelementptr inbounds [36 x i8], [36 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 36, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @strlen(i8* %3)
%6 = icmp slt i32 %5, 36
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = sub i32 36, %5
%9 = call i32 @llvm.smax.i32(i32 %8, i32 1)
br label %10
10: ; preds = %7, %10
%11 = phi i32 [ %13, %10 ], [ 0, %7 ]
%12 = call i32 @strcat(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = add nuw nsw i32 %11, 1
%14 = icmp eq i32 %13, %9
br i1 %14, label %15, label %10
15: ; preds = %10, %1
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %3)
ret void
}