int main(int argc, char **argv) {
  char *s1, *s2, *s3, *d1, *d2;
  s1 = "1.*.33.*";
  d1 = "*.*.com";
  printf("%d\n", random_int(1, 300));
  s2 = replace_str(s1, "*", "23");
  printf("s2=%s\n", s2);
  s3 = replace_ip(s1, "*");
  printf("s3=%s\n", s3);
  d2 = replace_domain(d1, "*");
  printf("d2=%s\n", d2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe9a(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe98(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    $0x1,%edi
mov    $0x12c,%esi
mov    $0x0,%al
call   1060 <random_int@plt>
mov    %eax,%esi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe66(%rip),%rsi
lea    0xe6d(%rip),%rdx
mov    $0x0,%al
call   1070 <replace_str@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe35(%rip),%rsi
mov    $0x0,%al
call   1030 <replace_ip@plt>
cltq
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
lea    0xe0b(%rip),%rsi
mov    $0x0,%al
call   1050 <replace_domain@plt>
cltq
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%edi
mov    $0x12c,%esi
xor    %eax,%eax
call   1060 <random_int@plt>
lea    0xea5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe84(%rip),%rbx
lea    0xe84(%rip),%r14
lea    0xe8b(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <replace_str@plt>
movslq %eax,%rsi
lea    0xe77(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <replace_ip@plt>
movslq %eax,%rsi
lea    0xe60(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe3c(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <replace_domain@plt>
movslq %eax,%rsi
lea    0xe45(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"1.*.33.*\00"
@.str.1 = [8 x i8] c"*.*.com\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [2 x i8] c"*\00"
@.str.4 = [3 x i8] c"23\00"
@.str.5 = [7 x i8] c"s2=%s\0A\00"
@.str.6 = [7 x i8] c"s3=%s\0A\00"
@.str.7 = [7 x i8] c"d2=%s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8** %8
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @random_int to i32 (i32, i32, ...)*)(i32 1, i32 300)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = load i8*, i8** %5
%13 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @replace_str to i32 (i8*, i8*, i8*, ...)*)(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %6
%16 = load i8*, i8** %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %16)
%18 = load i8*, i8** %5
%19 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @replace_ip to i32 (i8*, i8*, ...)*)(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %7
%22 = load i8*, i8** %7
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %22)
%24 = load i8*, i8** %8
%25 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @replace_domain to i32 (i8*, i8*, ...)*)(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%26 = sext i32 %25 to i64
%27 = inttoptr i64 %26 to i8*
store i8* %27, i8** %9
%28 = load i8*, i8** %9
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"1.*.33.*\00"
@.str.1 = [8 x i8] c"*.*.com\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [2 x i8] c"*\00"
@.str.4 = [3 x i8] c"23\00"
@.str.5 = [7 x i8] c"s2=%s\0A\00"
@.str.6 = [7 x i8] c"s3=%s\0A\00"
@.str.7 = [7 x i8] c"d2=%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @random_int to i32 (i32, i32, ...)*)(i32 1, i32 300)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @replace_str to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i8* %7)
%9 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @replace_ip to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %11)
%13 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @replace_domain to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i8*
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %15)
ret i32 0
}