#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 execve(char *, char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ strcat(char *, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, scalar_t__);
int main(int argc, char *argv[]) {
  char fullpath[1024];
  strncpy(fullpath, argv[0],
          strlen(argv[0]) - strlen("Trichlorotrifluoroethane"));
  strcat(fullpath, "Icy");
  char *newArgv[] = {fullpath, NULL};
  return execve(fullpath, newArgv, NULL);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x410(%rbp),%rax
mov    %rax,-0x430(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x428(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x438(%rbp)
lea    0xe71(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x438(%rbp),%rdx
mov    -0x430(%rbp),%rdi
mov    -0x428(%rbp),%rsi
sub    %rax,%rdx
call   1030 <strncpy@plt>
lea    -0x410(%rbp),%rdi
lea    0xe5a(%rip),%rsi
call   1060 <strcat@plt>
lea    -0x410(%rbp),%rax
mov    %rax,-0x420(%rbp)
movq   $0x0,-0x418(%rbp)
lea    -0x410(%rbp),%rdi
lea    -0x420(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1050 <execve@plt>
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x418,%rsp
mov    (%rsi),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    -0x18(%rax),%rdx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strncpy@plt>
lea    0xe90(%rip),%rsi
mov    %r14,%rdi
call   1060 <strcat@plt>
mov    %r14,(%rsp)
movq   $0x0,0x8(%rsp)
mov    %rsp,%rsi
mov    %r14,%rdi
xor    %edx,%edx
call   1050 <execve@plt>
add    $0x418,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Trichlorotrifluoroethane\00"
@.str.1 = [4 x i8] c"Icy\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
%7 = alloca [2 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i64 @strlen(i8* %14)
%16 = call i64 @strlen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%17 = sub nsw i64 %15, %16
%18 = call i32 @strncpy(i8* %8, i8* %11, i64 %17)
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%20 = call i32 @strcat(i8* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%21 = getelementptr inbounds [2 x i8*], [2 x i8*]* %7, i64 0, i64 0
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
store i8* %22, i8** %21
%23 = getelementptr inbounds i8*, i8** %21, i64 1
store i8* null, i8** %23
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%25 = getelementptr inbounds [2 x i8*], [2 x i8*]* %7, i64 0, i64 0
%26 = call i32 @execve(i8* %24, i8** %25, i32* null)
ret i32 %26
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"Icy\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [1024 x i8]
%4 = alloca [2 x i8*]
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%6 = load i8*, i8** %1
%7 = tail call i64 @strlen(i8* dereferenceable(1) %6)
%8 = add nsw i64 %7, -24
%9 = call i32 @strncpy(i8* %5, i8* %6, i64 %8)
%10 = call i32 @strcat(i8* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = bitcast [2 x i8*]* %4 to i8*
%12 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 0
store i8* %5, i8** %12
%13 = getelementptr inbounds [2 x i8*], [2 x i8*]* %4, i64 0, i64 1
store i8* null, i8** %13
%14 = call i32 @execve(i8* %5, i8** %12, i32* null)
ret i32 %14
}