#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 */
char *calloc(int, int);
char *charalloc(char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ get_irtype_llvm(char *, char *);
int /*<<< orphan*/ get_token_llvm(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int get_getelement_type(char *line, char *result) {
  char *token;
  char *buf;
  token = calloc(1024, 1);
  buf = charalloc(line);
  get_token_llvm(buf, token);
  get_token_llvm(buf, token);
  get_irtype_llvm(buf, token);
  strcpy(result, token);
  free(token);
  return 0;
}


x86 assembly (clang, -O0):
<get_getelement_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1080 <charalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <get_token_llvm@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <get_token_llvm@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <get_irtype_llvm@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_getelement_type>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
mov    $0x400,%edi
mov    $0x1,%esi
call   1070 <calloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
call   1080 <charalloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %rbx,%rsi
call   1060 <get_token_llvm@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <get_token_llvm@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <get_irtype_llvm@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @get_getelement_type(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = call i8* @calloc(i32 1024, i32 1)
store i8* %7, i8** %5
%8 = load i8*, i8** %3
%9 = call i8* @charalloc(i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = load i8*, i8** %5
%12 = call i32 @get_token_llvm(i8* %10, i8* %11)
%13 = load i8*, i8** %6
%14 = load i8*, i8** %5
%15 = call i32 @get_token_llvm(i8* %13, i8* %14)
%16 = load i8*, i8** %6
%17 = load i8*, i8** %5
%18 = call i32 @get_irtype_llvm(i8* %16, i8* %17)
%19 = load i8*, i8** %4
%20 = load i8*, i8** %5
%21 = call i32 @strcpy(i8* %19, i8* %20)
%22 = load i8*, i8** %5
%23 = call i32 @free(i8* %22)
ret i32 0
}

LLVM IR (-O2):
define i32 @get_getelement_type(i8* %0, i8* %1) {
%3 = tail call dereferenceable_or_null(1024) i8* @calloc(i32 1024, i32 1)
%4 = tail call i8* @charalloc(i8* %0)
%5 = tail call i32 @get_token_llvm(i8* %4, i8* %3)
%6 = tail call i32 @get_token_llvm(i8* %4, i8* %3)
%7 = tail call i32 @get_irtype_llvm(i8* %4, i8* %3)
%8 = tail call i32 @strcpy(i8* %1, i8* %3)
%9 = tail call i32 @free(i8* %3)
ret i32 0
}