#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 */
struct node {
  int dummy;
};

/* Variables and functions */
struct node *crfun(int);
struct node *delfun(struct node *, int);
struct node *hbfun(struct node *, struct node *);
struct node *insfun(struct node *, int);
int /*<<< orphan*/ putfun(struct node *);
int /*<<< orphan*/ scanf(char *, int *);
struct node *sortfun(struct node *);
void main() {
  struct node *head, *p1, *p2;
  int m;
  p1 = crfun(5);
  p2 = crfun(5);
  head = hbfun(p1, p2);
  scanf("%d", &m);
  head = delfun(p1, m);
  scanf("%d", &m);
  head = insfun(p1, m);
  head = sortfun(p1);
  putfun(head);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x5,%edi
call   1030 <crfun@plt>
mov    %rax,-0x10(%rbp)
mov    $0x5,%edi
call   1030 <crfun@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1090 <hbfun@plt>
mov    %rax,-0x8(%rbp)
lea    0xe54(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <delfun@plt>
mov    %rax,-0x8(%rbp)
lea    0xe34(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <insfun@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <sortfun@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <putfun@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    $0x5,%edi
call   1030 <crfun@plt>
mov    %rax,%rbx
mov    $0x5,%edi
call   1030 <crfun@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1090 <hbfun@plt>
lea    0xe5e(%rip),%r14
lea    0xc(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <delfun@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1060 <insfun@plt>
mov    %rbx,%rdi
call   1080 <sortfun@plt>
mov    %rax,%rdi
call   1070 <putfun@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.node = type { i32 }
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca %struct.node*
%2 = alloca %struct.node*
%3 = alloca %struct.node*
%4 = alloca i32
%5 = call %struct.node* @crfun(i32 5)
store %struct.node* %5, %struct.node** %2
%6 = call %struct.node* @crfun(i32 5)
store %struct.node* %6, %struct.node** %3
%7 = load %struct.node*, %struct.node** %2
%8 = load %struct.node*, %struct.node** %3
%9 = call %struct.node* @hbfun(%struct.node* %7, %struct.node* %8)
store %struct.node* %9, %struct.node** %1
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%11 = load %struct.node*, %struct.node** %2
%12 = load i32, i32* %4
%13 = call %struct.node* @delfun(%struct.node* %11, i32 %12)
store %struct.node* %13, %struct.node** %1
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%15 = load %struct.node*, %struct.node** %2
%16 = load i32, i32* %4
%17 = call %struct.node* @insfun(%struct.node* %15, i32 %16)
store %struct.node* %17, %struct.node** %1
%18 = load %struct.node*, %struct.node** %2
%19 = call %struct.node* @sortfun(%struct.node* %18)
store %struct.node* %19, %struct.node** %1
%20 = load %struct.node*, %struct.node** %1
%21 = call i32 @putfun(%struct.node* %20)
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
@.str = [3 x i8] c"%d\00"
define void @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call %struct.node* @crfun(i32 5)
%4 = tail call %struct.node* @crfun(i32 5)
%5 = tail call %struct.node* @hbfun(%struct.node* %3, %struct.node* %4)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = call %struct.node* @delfun(%struct.node* %3, i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = call %struct.node* @insfun(%struct.node* %3, i32 %10)
%12 = call %struct.node* @sortfun(%struct.node* %3)
%13 = call i32 @putfun(%struct.node* %12)
ret void
}