#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 mint_spread {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ mint_spread_del(struct mint_spread *);
struct mint_spread *mint_spread_dup(struct mint_spread *);
struct mint_spread *mint_spread_new(int);
int /*<<< orphan*/ mint_spread_save(struct mint_spread *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int main(void) {
  struct mint_spread *s1, *s2;
  s1 = mint_spread_new(3);
  mint_spread_save(s1, stderr);
  s2 = mint_spread_dup(s1);
  mint_spread_save(s2, stderr);
  mint_spread_del(s1);
  mint_spread_del(s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
call   1030 <mint_spread_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2e78(%rip),%rax
mov    (%rax),%esi
call   1040 <mint_spread_save@plt>
mov    -0x10(%rbp),%rdi
call   1060 <mint_spread_dup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2e59(%rip),%rax
mov    (%rax),%esi
call   1040 <mint_spread_save@plt>
mov    -0x10(%rbp),%rdi
call   1050 <mint_spread_del@plt>
mov    -0x18(%rbp),%rdi
call   1050 <mint_spread_del@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x3,%edi
call   1030 <mint_spread_new@plt>
mov    %rax,%rbx
mov    0x2e87(%rip),%r15
mov    (%r15),%esi
mov    %rax,%rdi
call   1040 <mint_spread_save@plt>
mov    %rbx,%rdi
call   1060 <mint_spread_dup@plt>
mov    %rax,%r14
mov    (%r15),%esi
mov    %rax,%rdi
call   1040 <mint_spread_save@plt>
mov    %rbx,%rdi
call   1050 <mint_spread_del@plt>
mov    %r14,%rdi
call   1050 <mint_spread_del@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.mint_spread = type { i32 }
@stderr = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.mint_spread*
%3 = alloca %struct.mint_spread*
store i32 0, i32* %1
%4 = call %struct.mint_spread* @mint_spread_new(i32 3)
store %struct.mint_spread* %4, %struct.mint_spread** %2
%5 = load %struct.mint_spread*, %struct.mint_spread** %2
%6 = load i32, i32* @stderr
%7 = call i32 @mint_spread_save(%struct.mint_spread* %5, i32 %6)
%8 = load %struct.mint_spread*, %struct.mint_spread** %2
%9 = call %struct.mint_spread* @mint_spread_dup(%struct.mint_spread* %8)
store %struct.mint_spread* %9, %struct.mint_spread** %3
%10 = load %struct.mint_spread*, %struct.mint_spread** %3
%11 = load i32, i32* @stderr
%12 = call i32 @mint_spread_save(%struct.mint_spread* %10, i32 %11)
%13 = load %struct.mint_spread*, %struct.mint_spread** %2
%14 = call i32 @mint_spread_del(%struct.mint_spread* %13)
%15 = load %struct.mint_spread*, %struct.mint_spread** %3
%16 = call i32 @mint_spread_del(%struct.mint_spread* %15)
ret i32 0
}

LLVM IR (-O2):
%struct.mint_spread = type { i32 }
@stderr = global i32 0
define i32 @main() {
%1 = tail call %struct.mint_spread* @mint_spread_new(i32 3)
%2 = load i32, i32* @stderr
%3 = tail call i32 @mint_spread_save(%struct.mint_spread* %1, i32 %2)
%4 = tail call %struct.mint_spread* @mint_spread_dup(%struct.mint_spread* %1)
%5 = load i32, i32* @stderr
%6 = tail call i32 @mint_spread_save(%struct.mint_spread* %4, i32 %5)
%7 = tail call i32 @mint_spread_del(%struct.mint_spread* %1)
%8 = tail call i32 @mint_spread_del(%struct.mint_spread* %4)
ret i32 0
}