#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 *alloc(int);
int /*<<< orphan*/ env_add(char *);
int /*<<< orphan*/ env_init();
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
void env_put2(const char *s, const char *t) {
  char *u;
  int slen;
  env_init();
  slen = strlen(s);
  u = alloc(slen + strlen(t) + 2);
  strcpy((u), (s));
  u[slen] = '=';
  strcpy((u + slen + 1), (t));
  env_add(u);
}


x86 assembly (clang, -O0):
<env_put2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1070 <env_init@plt>
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x20(%rbp),%edi
add    %eax,%edi
add    $0x2,%edi
call   1060 <alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x3d,(%rax,%rcx,1)
mov    -0x18(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1040 <env_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env_put2>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
xor    %eax,%eax
call   1070 <env_init@plt>
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %eax,%r12d
mov    %r14,%rdi
call   1050 <strlen@plt>
lea    (%r12,%rax,1),%edi
add    $0x2,%edi
call   1060 <alloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
movslq %r12d,%rax
movb   $0x3d,(%rbx,%rax,1)
lea    (%rbx,%rax,1),%rdi
add    $0x1,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <env_add@plt>

LLVM IR (-O0):
define void @env_put2(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = call i32 (...) @env_init()
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = load i8*, i8** %4
%12 = call i32 @strlen(i8* %11)
%13 = add nsw i32 %10, %12
%14 = add nsw i32 %13, 2
%15 = call i8* @alloc(i32 %14)
store i8* %15, i8** %5
%16 = load i8*, i8** %5
%17 = load i8*, i8** %3
%18 = call i32 @strcpy(i8* %16, i8* %17)
%19 = load i8*, i8** %5
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
store i8 61, i8* %22
%23 = load i8*, i8** %5
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = getelementptr inbounds i8, i8* %26, i64 1
%28 = load i8*, i8** %4
%29 = call i32 @strcpy(i8* %27, i8* %28)
%30 = load i8*, i8** %5
%31 = call i32 @env_add(i8* %30)
ret void
}

LLVM IR (-O2):
define void @env_put2(i8* %0, i8* %1) {
%3 = tail call i32 (...) @env_init()
%4 = tail call i32 @strlen(i8* %0)
%5 = tail call i32 @strlen(i8* %1)
%6 = add i32 %4, 2
%7 = add i32 %6, %5
%8 = tail call i8* @alloc(i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* %0)
%10 = sext i32 %4 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 61, i8* %11
%12 = getelementptr inbounds i8, i8* %11, i64 1
%13 = tail call i32 @strcpy(i8* %12, i8* %1)
%14 = tail call i32 @env_add(i8* %8)
ret void
}