xunge/DecIR huggingface dataset:
/* Type definitions */
typedef union node {
  int dummy;
} node;

/* Variables and functions */
int /*<<< orphan*/ tree_free(union node *);
void tree_remove(union node **nptr) {
  union node *node;
  if ((node = *nptr))
    tree_free(node);
  *nptr = 0;
}


x86 assembly (clang, -O0):
<tree_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
je     113a <tree_remove+0x2a>
mov    -0x10(%rbp),%rdi
call   1030 <tree_free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_remove>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1121 <tree_remove+0x11>
call   1030 <tree_free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%union.node = type { i32 }
define void @tree_remove(%union.node** %0) {
%2 = alloca %union.node**
%3 = alloca %union.node*
store %union.node** %0, %union.node*** %2
%4 = load %union.node**, %union.node*** %2
%5 = load %union.node*, %union.node** %4
store %union.node* %5, %union.node** %3
%6 = icmp ne %union.node* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load %union.node*, %union.node** %3
%9 = call i32 @tree_free(%union.node* %8)
br label %10
10: ; preds = %7, %1
%11 = load %union.node**, %union.node*** %2
store %union.node* null, %union.node** %11
ret void
}

LLVM IR (-O2):
%union.node = type { i32 }
define void @tree_remove(%union.node** nocapture %0) {
%2 = load %union.node*, %union.node** %0
%3 = icmp eq %union.node* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @tree_free(%union.node* %2)
br label %6
6: ; preds = %4, %1
store %union.node* null, %union.node** %0
ret void
}
/* Type definitions */
struct tree {
  int dummy;
};
struct node {
  int dummy;
};

/* Variables and functions */
struct node *tree_RB_FIND(struct tree *, struct node *);
__attribute__((unused)) struct node *tree_find_node(struct tree *t,
                                                    struct node *e) {
  return tree_RB_FIND(t, e);
}


x86 assembly (clang, -O0):
<tree_find_node>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <tree_RB_FIND@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tree_find_node>:
jmp    1030 <tree_RB_FIND@plt>

LLVM IR (-O0):
%struct.tree = type { i32 }
%struct.node = type { i32 }
define %struct.node* @tree_find_node(%struct.tree* %0, %struct.node* %1) {
%3 = alloca %struct.tree*
%4 = alloca %struct.node*
store %struct.tree* %0, %struct.tree** %3
store %struct.node* %1, %struct.node** %4
%5 = load %struct.tree*, %struct.tree** %3
%6 = load %struct.node*, %struct.node** %4
%7 = call %struct.node* @tree_RB_FIND(%struct.tree* %5, %struct.node* %6)
ret %struct.node* %7
}

LLVM IR (-O2):
%struct.tree = type { i32 }
%struct.node = type { i32 }
define %struct.node* @tree_find_node(%struct.tree* %0, %struct.node* %1) {
%3 = tail call %struct.node* @tree_RB_FIND(%struct.tree* %0, %struct.node* %1)
ret %struct.node* %3
}
/* Type definitions */
struct dirent {
  int dummy;
};

/* Variables and functions */
struct dirent **fileslast(struct dirent **allfiles) {
  struct dirent **ptr;
  for (ptr = allfiles; *ptr != NULL; ++ptr)
    ;
  return ptr;
}


x86 assembly (clang, -O0):
<fileslast>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1134 <fileslast+0x34>
jmp    1123 <fileslast+0x23>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <fileslast+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fileslast>:
mov    %rdi,%rax
add    $0xfffffffffffffff8,%rax
nopw   0x0(%rax,%rax,1)
cmpq   $0x0,0x8(%rax)
lea    0x8(%rax),%rax
jne    1110 <fileslast+0x10>
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
define %struct.dirent** @fileslast(%struct.dirent** %0) {
%2 = alloca %struct.dirent**
%3 = alloca %struct.dirent**
store %struct.dirent** %0, %struct.dirent*** %2
%4 = load %struct.dirent**, %struct.dirent*** %2
store %struct.dirent** %4, %struct.dirent*** %3
br label %5
5: ; preds = %10, %1
%6 = load %struct.dirent**, %struct.dirent*** %3
%7 = load %struct.dirent*, %struct.dirent** %6
%8 = icmp ne %struct.dirent* %7, null
br i1 %8, label %9, label %13
9: ; preds = %5
br label %10
10: ; preds = %9
%11 = load %struct.dirent**, %struct.dirent*** %3
%12 = getelementptr inbounds %struct.dirent*, %struct.dirent** %11, i32 1
store %struct.dirent** %12, %struct.dirent*** %3
br label %5
13: ; preds = %5
%14 = load %struct.dirent**, %struct.dirent*** %3
ret %struct.dirent** %14
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define %struct.dirent** @fileslast(%struct.dirent** %0) {
br label %2
2: ; preds = %2, %1
%3 = phi %struct.dirent** [ %0, %1 ], [ %6, %2 ]
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = icmp eq %struct.dirent* %4, null
%6 = getelementptr inbounds %struct.dirent*, %struct.dirent** %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret %struct.dirent** %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x3f() {
  Assert_real((isalnum(63) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalnum.c",
              320, ("isalnum should be 0 for ?"));
}


x86 assembly (clang, -O0):
<t_isalnum_0x3f>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3f,%edi
call   1030 <isalnum@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x140,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalnum_0x3f>:
push   %rax
mov    $0x3f,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x140,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for ?\00"
define void @t_isalnum_0x3f() {
%1 = call i64 @isalnum(i32 63)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 320, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for ?\00"
define void @t_isalnum_0x3f() {
%1 = tail call i64 @isalnum(i32 63)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 320, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned sub_sat_ul(unsigned long minuend, unsigned long subtrahend,
                    unsigned long limit) {
  if ((minuend < limit) || ((minuend - limit) < subtrahend))
    return limit;
  return (minuend - subtrahend);
}


x86 assembly (clang, -O0):
<sub_sat_ul>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jb     1130 <sub_sat_ul+0x30>
mov    -0x10(%rbp),%rax
sub    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    113c <sub_sat_ul+0x3c>
mov    -0x20(%rbp),%rax
mov    %eax,-0x4(%rbp)
jmp    1147 <sub_sat_ul+0x47>
mov    -0x10(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_sat_ul>:
mov    %rdi,%rcx
sub    %rdx,%rcx
mov    %edi,%eax
sub    %esi,%eax
cmp    %rsi,%rcx
cmovb  %edx,%eax
cmp    %rdx,%rdi
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @sub_sat_ul(i64 %0, i64 %1, i64 %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %5
%9 = load i64, i64* %7
%10 = icmp ult i64 %8, %9
br i1 %10, label %17, label %11
11: ; preds = %3
%12 = load i64, i64* %5
%13 = load i64, i64* %7
%14 = sub i64 %12, %13
%15 = load i64, i64* %6
%16 = icmp ult i64 %14, %15
br i1 %16, label %17, label %20
17: ; preds = %11, %3
%18 = load i64, i64* %7
%19 = trunc i64 %18 to i32
store i32 %19, i32* %4
br label %25
20: ; preds = %11
%21 = load i64, i64* %5
%22 = load i64, i64* %6
%23 = sub i64 %21, %22
%24 = trunc i64 %23 to i32
store i32 %24, i32* %4
br label %25
25: ; preds = %20, %17
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @sub_sat_ul(i64 %0, i64 %1, i64 %2) {
%4 = icmp ult i64 %0, %2
%5 = sub i64 %0, %2
%6 = icmp ult i64 %5, %1
%7 = or i1 %4, %6
%8 = sub i64 %0, %1
%9 = select i1 %7, i64 %2, i64 %8
%10 = trunc i64 %9 to i32
ret i32 %10
}
double val_h(double r) { return 1. - 1. / r; }


x86 assembly (clang, -O0):
<val_h>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm1
divsd  -0x8(%rbp),%xmm1
movsd  0xee2(%rip),%xmm0
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<val_h>:
movsd  0xef8(%rip),%xmm1
movapd %xmm1,%xmm2
divsd  %xmm0,%xmm2
subsd  %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @val_h(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double 1.000000e+00, %3
%5 = fsub double 1.000000e+00, %4
ret double %5
}

LLVM IR (-O2):
define double @val_h(double %0) {
%2 = fdiv double 1.000000e+00, %0
%3 = fsub double 1.000000e+00, %2
ret double %3
}
/* Variables and functions */
int PAPI_enum_event(int *, int);
void papif_enum_event__(int *EventCode, int *modifier, int *check) {
  *check = PAPI_enum_event(EventCode, *modifier);
}


x86 assembly (clang, -O0):
<papif_enum_event__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <PAPI_enum_event@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_enum_event__>:
push   %rbx
mov    %rdx,%rbx
mov    (%rsi),%esi
call   1030 <PAPI_enum_event@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_enum_event__(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = call i32 @PAPI_enum_event(i32* %7, i32 %9)
%11 = load i32*, i32** %6
store i32 %10, i32* %11
ret void
}

LLVM IR (-O2):
define void @papif_enum_event__(i32* %0, i32* nocapture %1, i32* nocapture writeonly %2) {
%4 = load i32, i32* %1
%5 = tail call i32 @PAPI_enum_event(i32* %0, i32 %4)
store i32 %5, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
int vsnprintf(char *, int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vsprintf(char *restrict s, const char *restrict fmt, va_list ap) {
  return vsnprintf(s, INT_MAX, fmt, ap);
}


x86 assembly (clang, -O0):
<vsprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eba(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
jmp    1030 <vsnprintf@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
define i32 @vsprintf(i8* noalias %0, i8* noalias %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* @INT_MAX
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @vsnprintf(i8* %7, i32 %8, i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define i32 @vsprintf(i8* noalias nocapture %0, i8* noalias nocapture %1, i32 %2) {
%4 = load i32, i32* @INT_MAX
%5 = tail call i32 @vsnprintf(i8* %0, i32 %4, i8* %1, i32 %2)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage() {
  fprintf(stderr, "smoothing via DCT convolution:  \n");
  fprintf(stderr, "    gaussconv_dct IN SIGMA OUT  \n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
lea    0xee9(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
push   %rbx
mov    0x2ec8(%rip),%rbx
mov    (%rbx),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef3(%rip),%rsi
pop    %rbx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"smoothing via DCT convolution: \0A\00"
@.str.1 = [34 x i8] c" gaussconv_dct IN SIGMA OUT \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"smoothing via DCT convolution: \0A\00"
@.str.1 = [34 x i8] c" gaussconv_dct IN SIGMA OUT \0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned long rhash_transmit(unsigned msg_id, void *dst, unsigned long ldata,
                             unsigned long rdata) {
  (void)msg_id;
  (void)dst;
  (void)ldata;
  (void)rdata;
  switch (msg_id) {
  default:
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<rhash_transmit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rhash_transmit>:
mov    $0xffffffffffffffff,%rax
ret

LLVM IR (-O0):
define i64 @rhash_transmit(i32 %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load i64, i64* %8
%13 = load i32, i32* %5
switch i32 %13, label %14 [
]
14: ; preds = %4
ret i64 -1
}

LLVM IR (-O2):
define i64 @rhash_transmit(i32 %0, i8* nocapture readnone %1, i64 %2, i64 %3) {
ret i64 -1
}
void g_option_group_set_parse_hooks() {}


x86 assembly (clang, -O0):
<g_option_group_set_parse_hooks>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_option_group_set_parse_hooks>:
ret

LLVM IR (-O0):
define void @g_option_group_set_parse_hooks() {
ret void
}

LLVM IR (-O2):
define void @g_option_group_set_parse_hooks() {
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
char *skip_whitespace(const char str[]) {
  while (isspace(*str)) {
    ++str;
  }
  return (char *)str;
}


x86 assembly (clang, -O0):
<skip_whitespace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     1143 <skip_whitespace+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_whitespace+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_whitespace>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <skip_whitespace+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @skip_whitespace(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %8, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @isspace(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %2
br label %3
11: ; preds = %3
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @skip_whitespace(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("usage: hostid firstname lastname emailaddress\n"); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [47 x i8] c"usage: hostid firstname lastname emailaddress\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [46 x i8] c"usage: hostid firstname lastname emailaddress\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void *calloc(int, int);
void *celt_alloc(int size) { return calloc(size, 1); }


x86 assembly (clang, -O0):
<celt_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<celt_alloc>:
mov    $0x1,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @celt_alloc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i8* @calloc(i32 %3, i32 1)
ret i8* %4
}

LLVM IR (-O2):
define noalias i8* @celt_alloc(i32 %0) {
%2 = tail call i8* @calloc(i32 %0, i32 1)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ dsfmt_gv_init_by_array(int /*<<< orphan*/ *, int);
void init_by_array(uint32_t init_key[], int key_length) {
  dsfmt_gv_init_by_array(init_key, key_length);
}


x86 assembly (clang, -O0):
<init_by_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <dsfmt_gv_init_by_array@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_by_array>:
jmp    1030 <dsfmt_gv_init_by_array@plt>

LLVM IR (-O0):
define void @init_by_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = call i32 @dsfmt_gv_init_by_array(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @init_by_array(i32* %0, i32 %1) {
%3 = tail call i32 @dsfmt_gv_init_by_array(i32* %0, i32 %1)
ret void
}
float r_abs(float *x) {
  if (*x >= 0.0F)
    return (*x);
  return (-*x);
}


x86 assembly (clang, -O0):
<r_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     112e <r_abs+0x2e>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1148 <r_abs+0x48>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<r_abs>:
movss  (%rdi),%xmm1
movaps 0xef5(%rip),%xmm2
xorps  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cmpnless %xmm1,%xmm0
andps  %xmm0,%xmm2
andnps %xmm1,%xmm0
orps   %xmm2,%xmm0
ret

LLVM IR (-O0):
define float @r_abs(float* %0) {
%2 = alloca float
%3 = alloca float*
store float* %0, float** %3
%4 = load float*, float** %3
%5 = load float, float* %4
%6 = fcmp oge float %5, 0.000000e+00
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load float*, float** %3
%9 = load float, float* %8
store float %9, float* %2
br label %14
10: ; preds = %1
%11 = load float*, float** %3
%12 = load float, float* %11
%13 = fneg float %12
store float %13, float* %2
br label %14
14: ; preds = %10, %7
%15 = load float, float* %2
ret float %15
}

LLVM IR (-O2):
define float @r_abs(float* nocapture %0) {
%2 = load float, float* %0
%3 = fcmp ult float %2, 0.000000e+00
%4 = fneg float %2
%5 = select i1 %3, float %4, float %2
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ cm_print_error(char *, char const *const, int const);
int /*<<< orphan*/ exit_test(int);
void _fail(const char *const file, const int line) {
  cm_print_error("%s:%u"
                 ": error: Failure!\n",
                 file, line);
  exit_test(1);
}


x86 assembly (clang, -O0):
<_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xec3(%rip),%rdi
call   1040 <cm_print_error@plt>
mov    $0x1,%edi
call   1030 <exit_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_fail>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
lea    0xed3(%rip),%rdi
call   1040 <cm_print_error@plt>
mov    $0x1,%edi
pop    %rax
jmp    1030 <exit_test@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"%s:%u: error: Failure!\0A\00"
define void @_fail(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @cm_print_error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6)
%8 = call i32 @exit_test(i32 1)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"%s:%u: error: Failure!\0A\00"
define void @_fail(i8* %0, i32 %1) {
%3 = tail call i32 @cm_print_error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%4 = tail call i32 @exit_test(i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint16_t XcmValueUInt16Swap(uint16_t val) {
  uint8_t *bytes = (uint8_t *)&val, new_val[2];
  {
    new_val[0] = bytes[1];
    new_val[1] = bytes[0];
    memcpy(&val, new_val, sizeof(val));
  }
  return val;
}


x86 assembly (clang, -O0):
<XcmValueUInt16Swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
lea    -0x18(%rbp),%rsi
lea    -0x4(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XcmValueUInt16Swap>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %edi,0x14(%rsp)
lea    0xc(%rsp),%rdi
lea    0x10(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0xc(%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @XcmValueUInt16Swap(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca [2 x i32]
store i32 %0, i32* %2
store i32* %2, i32** %3
%5 = load i32*, i32** %3
%6 = getelementptr inbounds i32, i32* %5, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 %7, i32* %8
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 1
store i32 %11, i32* %12
%13 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%14 = call i32 @memcpy(i32* %2, i32* %13, i32 4)
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @XcmValueUInt16Swap(i32 %0) {
%2 = alloca i32
%3 = alloca [2 x i32]
store i32 %0, i32* %2
%4 = bitcast [2 x i32]* %3 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %0, i32* %6
%7 = call i32 @memcpy(i32* %2, i32* %5, i32 4)
%8 = load i32, i32* %2
ret i32 %8
}
put_str(s) char *s;
{
  while (*s)
    put_ch(*s++);
}


x86 assembly (clang, -O0):
<put_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <put_str+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <put_ch@plt>
jmp    111c <put_str+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_str>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1135 <put_str+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <put_ch@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <put_str+0x10>
pop    %rbx
ret

LLVM IR (-O0):
define i32 @put_str(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
br label %4
4: ; preds = %8, %1
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
%7 = icmp ne i8 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
%11 = load i8, i8* %9
%12 = sext i8 %11 to i32
%13 = call i32 (i32, ...) bitcast (i32 (...)* @put_ch to i32 (i32, ...)*)(i32 %12)
br label %4
14: ; preds = %4
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @put_str(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @put_ch to i32 (i32, ...)*)(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret i32 undef
}
int zbuf4_to_int(unsigned char *buf) {
  return (buf[0] << 24) | (buf[1] << 16) || (buf[2] << 24) | buf[3];
}


x86 assembly (clang, -O0):
<zbuf4_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
shl    $0x18,%ecx
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x10,%eax
or     %eax,%ecx
mov    $0x1,%al
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    114b <zbuf4_to_int+0x4b>
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zbuf4_to_int>:
movzbl (%rdi),%ecx
shl    $0x18,%ecx
movzbl 0x1(%rdi),%edx
shl    $0x10,%edx
mov    $0x1,%eax
or     %ecx,%edx
je     1117 <zbuf4_to_int+0x17>
ret
movzbl 0x2(%rdi),%ecx
shl    $0x18,%ecx
movzbl 0x3(%rdi),%edx
xor    %eax,%eax
or     %ecx,%edx
setne  %al
ret

LLVM IR (-O0):
define i32 @zbuf4_to_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl i32 %6, 24
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %7, %12
%14 = icmp ne i32 %13, 0
br i1 %14, label %27, label %15
15: ; preds = %1
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 2
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 24
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = or i32 %20, %24
%26 = icmp ne i32 %25, 0
br label %27
27: ; preds = %15, %1
%28 = phi i1 [ true, %1 ], [ %26, %15 ]
%29 = zext i1 %28 to i32
ret i32 %29
}

LLVM IR (-O2):
define i32 @zbuf4_to_int(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = shl nuw i32 %3, 24
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl nuw nsw i32 %7, 16
%9 = or i32 %8, %4
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %22
11: ; preds = %1
%12 = getelementptr inbounds i8, i8* %0, i64 2
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = shl nuw i32 %14, 24
%16 = getelementptr inbounds i8, i8* %0, i64 3
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = or i32 %15, %18
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i32
br label %22
22: ; preds = %11, %1
%23 = phi i32 [ 1, %1 ], [ %21, %11 ]
ret i32 %23
}
/* Variables and functions */
int /*<<< orphan*/ reinitTerminal();
void closeKeyboardManager() { reinitTerminal(); }


x86 assembly (clang, -O0):
<closeKeyboardManager>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <reinitTerminal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<closeKeyboardManager>:
xor    %eax,%eax
jmp    1030 <reinitTerminal@plt>

LLVM IR (-O0):
define void @closeKeyboardManager() {
%1 = call i32 (...) @reinitTerminal()
ret void
}

LLVM IR (-O2):
define void @closeKeyboardManager() {
%1 = tail call i32 (...) @reinitTerminal()
ret void
}
/* Type definitions */
struct tty_struct {
  int dummy;
};
struct file {
  int dummy;
};

/* Variables and functions */
int EIO;
int ptm_open_peer(struct file *master, struct tty_struct *tty, int flags) {
  return -EIO;
}


x86 assembly (clang, -O0):
<ptm_open_peer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
mov    0x2ec8(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptm_open_peer>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.file = type { i32 }
%struct.tty_struct = type { i32 }
@EIO = global i32 0
define i32 @ptm_open_peer(%struct.file* %0, %struct.tty_struct* %1, i32 %2) {
%4 = alloca %struct.file*
%5 = alloca %struct.tty_struct*
%6 = alloca i32
store %struct.file* %0, %struct.file** %4
store %struct.tty_struct* %1, %struct.tty_struct** %5
store i32 %2, i32* %6
%7 = load i32, i32* @EIO
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.file = type { i32 }
%struct.tty_struct = type { i32 }
@EIO = global i32 0
define i32 @ptm_open_peer(%struct.file* nocapture readnone %0, %struct.tty_struct* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @EIO
%5 = sub nsw i32 0, %4
ret i32 %5
}
unsigned xrop3_19_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D & T;
  stk1 = S | stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_19_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_19_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
or     %esi,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_19_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %5
%23 = load i32, i32* %7
%24 = and i32 %22, %23
store i32 %24, i32* %9
%25 = load i32, i32* %6
%26 = load i32, i32* %9
%27 = or i32 %25, %26
store i32 %27, i32* %8
%28 = load i32, i32* %8
%29 = xor i32 %28, -1
store i32 %29, i32* %8
%30 = load i32, i32* %8
%31 = load i32, i32* %6
%32 = xor i32 %31, -1
%33 = and i32 %30, %32
%34 = load i32, i32* %5
%35 = load i32, i32* %6
%36 = and i32 %34, %35
%37 = or i32 %33, %36
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_19_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i32 %4, %5
%7 = xor i32 %6, -1
%8 = or i32 %7, %3
ret i32 %8
}
char *dummy_dgettext(const char *domainname, const char *msgid) {
  return (char *)(msgid);
}


x86 assembly (clang, -O0):
<dummy_dgettext>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dummy_dgettext>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @dummy_dgettext(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
ret i8* %5
}

LLVM IR (-O2):
define i8* @dummy_dgettext(i8* nocapture readnone %0, i8* readnone returned %1) {
ret i8* %1
}
const char *ls_cost_nm9_name_in(int i) {
  switch (i) {
  case 0:
    return "i0";
  case 1:
    return "i1";
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<ls_cost_nm9_name_in>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     112b <ls_cost_nm9_name_in+0x2b>
jmp    111a <ls_cost_nm9_name_in+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     113b <ls_cost_nm9_name_in+0x3b>
jmp    114b <ls_cost_nm9_name_in+0x4b>
lea    0xece(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm9_name_in+0x53>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <ls_cost_nm9_name_in+0x53>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls_cost_nm9_name_in>:
xor    %ecx,%ecx
cmp    $0x1,%edi
lea    0xef7(%rip),%rax
cmove  %rax,%rcx
test   %edi,%edi
lea    0xee7(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @ls_cost_nm9_name_in(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 0, label %5
i32 1, label %6
]
5: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %2
br label %8
6: ; preds = %1
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %8
7: ; preds = %1
store i8* null, i8** %2
br label %8
8: ; preds = %7, %6, %5
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"i0\00"
@.str.1 = [3 x i8] c"i1\00"
define i8* @ls_cost_nm9_name_in(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* null
%4 = icmp eq i32 %0, 0
%5 = select i1 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long requestor;
};
struct TYPE_4__ {
  TYPE_1__ xselection;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xselection_requestor(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xselection.requestor = (unsigned long)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xselection_requestor>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_XEvent_xselection_requestor>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xselection_requestor(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xselection_requestor(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Type definitions */
typedef int uid_t;
typedef int pid_t;

/* Variables and functions */
int geteuid();
int getpid();
int getuid();
int /*<<< orphan*/ printf(char *, int);
int main() {
  pid_t pid;
  pid = getpid();
  printf("pid : %d\n", pid);
  uid_t uid;
  uid = getuid();
  printf("uid: %d\n", uid);
  uid_t euid;
  euid = geteuid();
  printf("euid: %d\n", euid);
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9d(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <geteuid@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe75(%rip),%rdi
call   1050 <printf@plt>
jmp    119a <main+0x5a>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <getuid@plt>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <geteuid@plt>
lea    0xe91(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
jmp    1180 <main+0x40>

LLVM IR (-O0):
@.str = [10 x i8] c"pid : %d\0A\00"
@.str.1 = [9 x i8] c"uid: %d\0A\00"
@.str.2 = [10 x i8] c"euid: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @getpid()
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = call i32 (...) @getuid()
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %9)
%11 = call i32 (...) @geteuid()
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %12)
br label %14
14: ; preds = %0, %14
br label %14
}

LLVM IR (-O2):
@.str = [10 x i8] c"pid : %d\0A\00"
@.str.1 = [9 x i8] c"uid: %d\0A\00"
@.str.2 = [10 x i8] c"euid: %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (...) @getuid()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 (...) @geteuid()
%6 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %5)
br label %7
7: ; preds = %7, %0
br label %7
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fexpectstr(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ fnextc(int /*<<< orphan*/ *, int /*<<< orphan*/);
int fexpecttoken(register FILE *file, char *str) {
  (void)fnextc(file, 0);
  return fexpectstr(file, str);
}


x86 assembly (clang, -O0):
<fexpecttoken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <fnextc@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <fexpectstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fexpecttoken>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <fnextc@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fexpectstr@plt>

LLVM IR (-O0):
define i32 @fexpecttoken(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = call i32 @fnextc(i32* %5, i32 0)
%7 = load i32*, i32** %3
%8 = load i8*, i8** %4
%9 = call i32 @fexpectstr(i32* %7, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @fexpecttoken(i32* %0, i8* %1) {
%3 = tail call i32 @fnextc(i32* %0, i32 0)
%4 = tail call i32 @fexpectstr(i32* %0, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ stat();
void foo(void) { stat(); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <stat@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %eax,%eax
jmp    1030 <stat@plt>

LLVM IR (-O0):
define void @foo() {
%1 = call i32 (...) @stat()
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = tail call i32 (...) @stat()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ my_strcat(char *, char *, int, int);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char a[40] = "hello world!";
  char b[20] = "hello Miss Dong";
  my_strcat(a, b, 15, 16 + 12);
  printf("%s", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
mov    0xed5(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xed2(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xed0(%rip),%eax
mov    %eax,-0x40(%rbp)
lea    -0x30(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0xf,%edx
mov    $0x1c,%ecx
call   1040 <my_strcat@plt>
lea    -0x30(%rbp),%rsi
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec8(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movq   $0x0,0x40(%rsp)
movaps 0xee3(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
lea    0x20(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0xf,%edx
mov    $0x1c,%ecx
call   1040 <my_strcat@plt>
lea    0xeca(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [40 x i8] c"hello world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.b = [20 x i8] c"hello Miss Dong\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [40 x i8]
%3 = alloca [20 x i8]
store i32 0, i32* %1
%4 = bitcast [40 x i8]* %2 to i8*
%5 = bitcast [20 x i8]* %3 to i8*
%6 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = call i32 @my_strcat(i8* %6, i8* %7, i32 15, i32 28)
%9 = getelementptr inbounds [40 x i8], [40 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [40 x i8] c"hello world!\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.b = [20 x i8] c"hello Miss Dong\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [40 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [40 x i8], [40 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = call i32 @my_strcat(i8* %3, i8* %4, i32 15, i32 28)
%6 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
void pneigh_refcnt_init(struct pneigh_entry *pneigh) {}


x86 assembly (clang, -O0):
<pneigh_refcnt_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pneigh_refcnt_init>:
ret

LLVM IR (-O0):
%struct.pneigh_entry = type opaque
define void @pneigh_refcnt_init(%struct.pneigh_entry* %0) {
%2 = alloca %struct.pneigh_entry*
store %struct.pneigh_entry* %0, %struct.pneigh_entry** %2
ret void
}

LLVM IR (-O2):
%struct.pneigh_entry = type opaque
define void @pneigh_refcnt_init(%struct.pneigh_entry* nocapture %0) {
ret void
}
/* Variables and functions */
int problem();
int main() { return problem() - 55; }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <problem@plt>
sub    $0x37,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <problem@plt>
add    $0xffffffc9,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @problem()
%3 = sub nsw i32 %2, 55
ret i32 %3
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @problem()
%2 = add nsw i32 %1, -55
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ mshort2();
int /*<<< orphan*/ nonimpexpres();
void mshort(void) {
  nonimpexpres();
  mshort2();
}


x86 assembly (clang, -O0):
<mshort>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <nonimpexpres@plt>
mov    $0x0,%al
call   1030 <mshort2@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mshort>:
push   %rax
xor    %eax,%eax
call   1040 <nonimpexpres@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <mshort2@plt>

LLVM IR (-O0):
define void @mshort() {
%1 = call i32 (...) @nonimpexpres()
%2 = call i32 (...) @mshort2()
ret void
}

LLVM IR (-O2):
define void @mshort() {
%1 = tail call i32 (...) @nonimpexpres()
%2 = tail call i32 (...) @mshort2()
ret void
}
int readCounter(void) {
  int *IO = (int *)(0x3c000000 + 5 * 0x00000020);
  return *IO;
}


x86 assembly (clang, -O0):
<readCounter>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3c0000a0,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<readCounter>:
mov    0x3c0000a0,%eax
ret

LLVM IR (-O0):
define i32 @readCounter() {
%1 = alloca i32*
store i32* inttoptr (i64 1006633120 to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = load i32, i32* %2
ret i32 %3
}

LLVM IR (-O2):
define i32 @readCounter() {
%1 = load i32, i32* inttoptr (i64 1006633120 to i32*)
ret i32 %1
}