int main(void) {
  printf("%llu\n", unsigned_sub(30, 10));
  printf("%lld\n", signed_sub(30, 10));
  printf("%g\n", float_sub(30, 10));
  printf("%g\n", double_sub(30, 10));
  char test_str[100] = "20";
  printf("%s\n", ptr_int_sub(test_str + 1, 1));
  char long_test_str[100] = "abcdefghijklmnopqrstuvwxyz";
  printf("%lld\n", ptr_ptr_sub(long_test_str + 20, long_test_str));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    $0x1e,%edi
mov    $0xa,%esi
mov    $0x0,%al
call   10b0 <unsigned_sub@plt>
mov    %eax,%esi
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1e,%edi
mov    $0xa,%esi
mov    $0x0,%al
call   1080 <signed_sub@plt>
mov    %eax,%esi
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1e,%edi
mov    $0xa,%esi
mov    $0x0,%al
call   1050 <float_sub@plt>
mov    %eax,%esi
lea    0xe15(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1e,%edi
mov    $0xa,%esi
mov    $0x0,%al
call   10a0 <double_sub@plt>
mov    %eax,%esi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
movb   $0x32,-0x70(%rbp)
movb   $0x30,-0x6f(%rbp)
lea    -0x70(%rbp),%rdi
add    $0x1,%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <ptr_int_sub@plt>
mov    %eax,%esi
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xe0(%rbp),%rdi
lea    0xdb7(%rip),%rsi
mov    $0x64,%edx
call   1070 <memcpy@plt>
lea    -0xe0(%rbp),%rdi
add    $0x14,%rdi
lea    -0xe0(%rbp),%rsi
mov    $0x0,%al
call   1090 <ptr_ptr_sub@plt>
mov    %eax,%esi
lea    0xd71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
mov    $0x1e,%edi
mov    $0xa,%esi
xor    %eax,%eax
call   1090 <unsigned_sub@plt>
lea    0xe6e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1e,%edi
mov    $0xa,%esi
xor    %eax,%eax
call   1060 <signed_sub@plt>
lea    0xe53(%rip),%r14
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1e,%edi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <float_sub@plt>
lea    0xe35(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1e,%edi
mov    $0xa,%esi
xor    %eax,%eax
call   1080 <double_sub@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movl   $0x0,0xd0(%rsp)
movw   $0x3032,0x70(%rsp)
lea    0x71(%rsp),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <ptr_int_sub@plt>
lea    0xdb6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
movaps 0xe06(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xdea(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xdce(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xdb2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xd96(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xd7a(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
lea    0x14(%rsp),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1070 <ptr_ptr_sub@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%llu\0A\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
@.str.2 = [4 x i8] c"%g\0A\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@__const.main.long_test_str = [100 x i8] c"abcdefghijklmnopqrstuvwxyz\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = call i32 (i32, i32, ...) bitcast (i32 (...)* @unsigned_sub to i32 (i32, i32, ...)*)(i32 30, i32 10)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 (i32, i32, ...) bitcast (i32 (...)* @signed_sub to i32 (i32, i32, ...)*)(i32 30, i32 10)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 (i32, i32, ...) bitcast (i32 (...)* @float_sub to i32 (i32, i32, ...)*)(i32 30, i32 10)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = call i32 (i32, i32, ...) bitcast (i32 (...)* @double_sub to i32 (i32, i32, ...)*)(i32 30, i32 10)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = bitcast [100 x i8]* %1 to i8*
%12 = bitcast i8* %11 to [100 x i8]*
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i32 0, i32 0
store i8 50, i8* %13
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %12, i32 0, i32 1
store i8 48, i8* %14
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @ptr_int_sub to i32 (i8*, i32, ...)*)(i8* %16, i32 1)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = bitcast [100 x i8]* %2 to i8*
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%21 = getelementptr inbounds i8, i8* %20, i64 20
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%23 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @ptr_ptr_sub to i32 (i8*, i8*, ...)*)(i8* %21, i8* %22)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%llu\0A\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
@.str.2 = [4 x i8] c"%g\0A\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@__const.main.long_test_str = [100 x i8] c"abcdefghijklmnopqrstuvwxyz\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @unsigned_sub to i32 (i32, i32, ...)*)(i32 30, i32 10)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @signed_sub to i32 (i32, i32, ...)*)(i32 30, i32 10)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @float_sub to i32 (i32, i32, ...)*)(i32 30, i32 10)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @double_sub to i32 (i32, i32, ...)*)(i32 30, i32 10)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
store i8 50, i8* %11
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 1
store i8 48, i8* %12
%13 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @ptr_int_sub to i32 (i8*, i32, ...)*)(i8* %12, i32 1)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %13)
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 20
%17 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @ptr_ptr_sub to i32 (i8*, i8*, ...)*)(i8* %16, i8* %15)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %17)
ret i32 0
}