#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 */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ snprintf(char *, int, char *, int const);
char *strdup(char *);
char *mtu_tostr(const int mtu, const int size) {
  char str[24];
  if (mtu != size)
    snprintf(str, sizeof(str), " [*mtu: %d]", size);
  else
    snprintf(str, sizeof(str), " [mtu: %d]", mtu);
  return strdup(str);
}


x86 assembly (clang, -O0):
<mtu_tostr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
je     1157 <mtu_tostr+0x37>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0x18,%esi
lea    0xeb3(%rip),%rdx
call   1030 <snprintf@plt>
jmp    116f <mtu_tostr+0x4f>
lea    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x18,%esi
lea    0xea2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x20(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtu_tostr>:
sub    $0x18,%rsp
cmp    %esi,%edi
jne    113d <mtu_tostr+0x1d>
mov    %edi,%eax
lea    0xedb(%rip),%rdx
mov    %rsp,%rdi
mov    $0x18,%esi
mov    %eax,%ecx
jmp    114e <mtu_tostr+0x2e>
mov    %esi,%ecx
lea    0xeba(%rip),%rdx
mov    %rsp,%rdi
mov    $0x18,%esi
call   1030 <snprintf@plt>
mov    %rsp,%rdi
call   1040 <strdup@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [12 x i8] c" [*mtu: %d]\00"
@.str.1 = [11 x i8] c" [mtu: %d]\00"
define i8* @mtu_tostr(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [24 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = getelementptr inbounds [24 x i8], [24 x i8]* %5, i64 0, i64 0
%11 = load i32, i32* %4
%12 = call i32 @snprintf(i8* %10, i32 24, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %17
13: ; preds = %2
%14 = getelementptr inbounds [24 x i8], [24 x i8]* %5, i64 0, i64 0
%15 = load i32, i32* %3
%16 = call i32 @snprintf(i8* %14, i32 24, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %13, %9
%18 = getelementptr inbounds [24 x i8], [24 x i8]* %5, i64 0, i64 0
%19 = call i8* @strdup(i8* %18)
ret i8* %19
}

LLVM IR (-O2):
@.str = [12 x i8] c" [*mtu: %d]\00"
@.str.1 = [11 x i8] c" [mtu: %d]\00"
define noalias i8* @mtu_tostr(i32 %0, i32 %1) {
%3 = alloca [24 x i8]
%4 = getelementptr inbounds [24 x i8], [24 x i8]* %3, i64 0, i64 0
%5 = icmp eq i32 %0, %1
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = call i32 @snprintf(i8* %4, i32 24, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %10
8: ; preds = %2
%9 = call i32 @snprintf(i8* %4, i32 24, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %0)
br label %10
10: ; preds = %8, %6
%11 = call i8* @strdup(i8* %4)
ret i8* %11
}