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

/* Variables and functions */
int merge_fields(struct _segment_merger *);
int /*<<< orphan*/ merge_norms(struct _segment_merger *);
int /*<<< orphan*/ merge_terms(struct _segment_merger *);
int /*<<< orphan*/ printf(char *, char *);
int segment_merger_merge(struct _segment_merger *sm) {
  int value;
  printf("%s\n", "SegmentMerger:merge:mergeFields:^^^^^^^^^^^");
  value = merge_fields(sm);
  printf("%s\n", "SegmentMerger:merge:mergeFields:$$$$$$$$$$$");
  printf("%s\n", "SegmentMerger:merge:mergeTerms:^^^^^^^^^^^^");
  merge_terms(sm);
  printf("%s\n", "SegmentMerger:merge:mergeTerms:$$$$$$$$$$$$");
  printf("%s\n", "SegmentMerger:merge:mergenorms:^^^^^^^^^^^^");
  merge_norms(sm);
  printf("%s\n", "SegmentMerger:merge:mergenorms:$$$$$$$$$$$$");
  return value;
}


x86 assembly (clang, -O0):
<segment_merger_merge>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xead(%rip),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1060 <merge_fields@plt>
mov    %eax,-0xc(%rbp)
lea    0xe8e(%rip),%rdi
lea    0xeb7(%rip),%rsi
call   1030 <printf@plt>
lea    0xe7b(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <merge_terms@plt>
lea    0xe5f(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <printf@plt>
lea    0xe4c(%rip),%rdi
lea    0xef9(%rip),%rsi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1050 <merge_norms@plt>
lea    0xe30(%rip),%rdi
lea    0xf09(%rip),%rsi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<segment_merger_merge>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xeb2(%rip),%r14
lea    0xeaf(%rip),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1060 <merge_fields@plt>
mov    %eax,%ebp
lea    0xec2(%rip),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1040 <merge_terms@plt>
lea    0xef4(%rip),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
lea    0xf11(%rip),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   1050 <merge_norms@plt>
lea    0xf26(%rip),%rsi
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct._segment_merger = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [44 x i8] c"SegmentMerger:merge:mergeFields:^^^^^^^^^^^\00"
@.str.2 = [44 x i8] c"SegmentMerger:merge:mergeFields:$$$$$$$$$$$\00"
@.str.3 = [44 x i8] c"SegmentMerger:merge:mergeTerms:^^^^^^^^^^^^\00"
@.str.4 = [44 x i8] c"SegmentMerger:merge:mergeTerms:$$$$$$$$$$$$\00"
@.str.5 = [44 x i8] c"SegmentMerger:merge:mergenorms:^^^^^^^^^^^^\00"
@.str.6 = [44 x i8] c"SegmentMerger:merge:mergenorms:$$$$$$$$$$$$\00"
define i32 @segment_merger_merge(%struct._segment_merger* %0) {
%2 = alloca %struct._segment_merger*
%3 = alloca i32
store %struct._segment_merger* %0, %struct._segment_merger** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%5 = load %struct._segment_merger*, %struct._segment_merger** %2
%6 = call i32 @merge_fields(%struct._segment_merger* %5)
store i32 %6, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%9 = load %struct._segment_merger*, %struct._segment_merger** %2
%10 = call i32 @merge_terms(%struct._segment_merger* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
%13 = load %struct._segment_merger*, %struct._segment_merger** %2
%14 = call i32 @merge_norms(%struct._segment_merger* %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
%struct._segment_merger = type { i32 }
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [44 x i8] c"SegmentMerger:merge:mergeFields:^^^^^^^^^^^\00"
@.str.2 = [44 x i8] c"SegmentMerger:merge:mergeFields:$$$$$$$$$$$\00"
@.str.3 = [44 x i8] c"SegmentMerger:merge:mergeTerms:^^^^^^^^^^^^\00"
@.str.4 = [44 x i8] c"SegmentMerger:merge:mergeTerms:$$$$$$$$$$$$\00"
@.str.5 = [44 x i8] c"SegmentMerger:merge:mergenorms:^^^^^^^^^^^^\00"
@.str.6 = [44 x i8] c"SegmentMerger:merge:mergenorms:$$$$$$$$$$$$\00"
define i32 @segment_merger_merge(%struct._segment_merger* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @merge_fields(%struct._segment_merger* %0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
%6 = tail call i32 @merge_terms(%struct._segment_merger* %0)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0))
%9 = tail call i32 @merge_norms(%struct._segment_merger* %0)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0))
ret i32 %3
}