int main() {
  char *ptr;
  char stuff[100];
  int value;
  ptr = stuff;
  gets(stuff);
  print(stuff);
  getl(ptr);
  print(stuff);
  print("\n");
  geti(value);
  print(value);
  print("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x80(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
mov    $0x0,%al
call   1050 <gets@plt>
lea    -0x80(%rbp),%rdi
mov    $0x0,%al
call   1040 <print@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <getl@plt>
lea    -0x80(%rbp),%rdi
mov    $0x0,%al
call   1040 <print@plt>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1040 <print@plt>
mov    -0x84(%rbp),%edi
mov    $0x0,%al
call   1060 <geti@plt>
mov    -0x84(%rbp),%edi
mov    $0x0,%al
call   1040 <print@plt>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1040 <print@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <gets@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <print@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <getl@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <print@plt>
lea    0xe89(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <print@plt>
xor    %eax,%eax
call   1060 <geti@plt>
xor    %eax,%eax
call   1040 <print@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <print@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca [100 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
store i8* %5, i8** %2
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %6)
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* %8)
%10 = load i8*, i8** %2
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @getl to i32 (i8*, ...)*)(i8* %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* %12)
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = load i32, i32* %4
%16 = call i32 (i32, ...) bitcast (i32 (...)* @geti to i32 (i32, ...)*)(i32 %15)
%17 = load i32, i32* %4
%18 = call i32 (i32, ...) bitcast (i32 (...)* @print to i32 (i32, ...)*)(i32 %17)
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @gets to i32 (i8*, ...)*)(i8* %2)
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* %2)
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @getl to i32 (i8*, ...)*)(i8* %2)
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* %2)
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i32, ...) bitcast (i32 (...)* @geti to i32 (i32, ...)*)(i32 undef)
%9 = call i32 (i32, ...) bitcast (i32 (...)* @print to i32 (i32, ...)*)(i32 undef)
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @print to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}