#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*/ escapeSeq(char *);
int /*<<< orphan*/ extend(char *, char *);
int /*<<< orphan*/ range(char *);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ trans(char *, char *);
int /*<<< orphan*/ truncate(char *, char *);
void extend_checker(char s1[], char s2[]) {
  char news1[512];
  strcpy(news1, s1);
  escapeSeq(news1);
  escapeSeq(s2);
  range(news1);
  range(s2);
  if (strlen(news1) > strlen(s2)) {
    extend(news1, s2);
  } else if (strlen(s2) > strlen(news1)) {
    truncate(news1, s2);
  }
  trans(news1, s2);
}


x86 assembly (clang, -O0):
<extend_checker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x210(%rbp),%rdi
call   1050 <escapeSeq@plt>
mov    -0x10(%rbp),%rdi
call   1050 <escapeSeq@plt>
lea    -0x210(%rbp),%rdi
call   1080 <range@plt>
mov    -0x10(%rbp),%rdi
call   1080 <range@plt>
lea    -0x210(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x218(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,%rcx
mov    -0x218(%rbp),%rax
cmp    %rcx,%rax
jle    1201 <extend_checker+0x91>
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1090 <extend@plt>
jmp    1245 <extend_checker+0xd5>
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,-0x220(%rbp)
lea    -0x210(%rbp),%rdi
call   1060 <strlen@plt>
mov    %rax,%rcx
mov    -0x220(%rbp),%rax
cmp    %rcx,%rax
jle    1240 <extend_checker+0xd0>
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1070 <truncate@plt>
jmp    1245 <extend_checker+0xd5>
lea    -0x210(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <trans@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extend_checker>:
push   %r14
push   %rbx
sub    $0x208,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <strcpy@plt>
mov    %r14,%rdi
call   1050 <escapeSeq@plt>
mov    %rbx,%rdi
call   1050 <escapeSeq@plt>
mov    %r14,%rdi
call   1080 <range@plt>
mov    %rbx,%rdi
call   1080 <range@plt>
mov    %r14,%rdi
call   1060 <strlen@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1060 <strlen@plt>
cmp    %rax,%r14
jle    11d0 <extend_checker+0x60>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1090 <extend@plt>
jmp    11dd <extend_checker+0x6d>
jge    11dd <extend_checker+0x6d>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1070 <truncate@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1040 <trans@plt>
add    $0x208,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @extend_checker(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [512 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @strcpy(i8* %6, i8* %7)
%9 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%10 = call i32 @escapeSeq(i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 @escapeSeq(i8* %11)
%13 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%14 = call i32 @range(i8* %13)
%15 = load i8*, i8** %4
%16 = call i32 @range(i8* %15)
%17 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%18 = call i64 @strlen(i8* %17)
%19 = load i8*, i8** %4
%20 = call i64 @strlen(i8* %19)
%21 = icmp sgt i64 %18, %20
br i1 %21, label %22, label %26
22: ; preds = %2
%23 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%24 = load i8*, i8** %4
%25 = call i32 @extend(i8* %23, i8* %24)
br label %37
26: ; preds = %2
%27 = load i8*, i8** %4
%28 = call i64 @strlen(i8* %27)
%29 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%30 = call i64 @strlen(i8* %29)
%31 = icmp sgt i64 %28, %30
br i1 %31, label %32, label %36
32: ; preds = %26
%33 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%34 = load i8*, i8** %4
%35 = call i32 @truncate(i8* %33, i8* %34)
br label %36
36: ; preds = %32, %26
br label %37
37: ; preds = %36, %22
%38 = getelementptr inbounds [512 x i8], [512 x i8]* %5, i64 0, i64 0
%39 = load i8*, i8** %4
%40 = call i32 @trans(i8* %38, i8* %39)
ret void
}

LLVM IR (-O2):
define void @extend_checker(i8* %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @strcpy(i8* %4, i8* %0)
%6 = call i32 @escapeSeq(i8* %4)
%7 = call i32 @escapeSeq(i8* %1)
%8 = call i32 @range(i8* %4)
%9 = call i32 @range(i8* %1)
%10 = call i64 @strlen(i8* %4)
%11 = call i64 @strlen(i8* dereferenceable(1) %1)
%12 = icmp sgt i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 @extend(i8* %4, i8* %1)
br label %19
15: ; preds = %2
%16 = icmp sgt i64 %11, %10
br i1 %16, label %17, label %19
17: ; preds = %15
%18 = call i32 @truncate(i8* %4, i8* %1)
br label %19
19: ; preds = %15, %17, %13
%20 = call i32 @trans(i8* %4, i8* %1)
ret void
}