xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int /*<<< orphan*/ ivory_serialize_unpack_prim_2_be(int /*<<< orphan*/ const *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void ivory_serialize_unpack_int16_be(const uint8_t *src, uint32_t offs,
                                     int16_t *dst) {
  uint16_t tmp = ivory_serialize_unpack_prim_2_be(src + offs);
  memcpy(dst, &tmp, sizeof(*dst));
}


x86 assembly (clang, -O0):
<ivory_serialize_unpack_int16_be>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
call   1030 <ivory_serialize_unpack_prim_2_be@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ivory_serialize_unpack_int16_be>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movslq %esi,%rax
lea    (%rdi,%rax,4),%rdi
call   1030 <ivory_serialize_unpack_prim_2_be@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @ivory_serialize_unpack_int16_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = call i32 @ivory_serialize_unpack_prim_2_be(i32* %11)
store i32 %12, i32* %7
%13 = load i32*, i32** %6
%14 = call i32 @memcpy(i32* %13, i32* %7, i32 4)
ret void
}

LLVM IR (-O2):
define void @ivory_serialize_unpack_int16_be(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = sext i32 %1 to i64
%7 = getelementptr inbounds i32, i32* %0, i64 %6
%8 = tail call i32 @ivory_serialize_unpack_prim_2_be(i32* %7)
store i32 %8, i32* %4
%9 = call i32 @memcpy(i32* %2, i32* %4, i32 4)
ret void
}
char *putn(n)
register int n;
{ return (itoa(n, -1)); }


x86 assembly (clang, -O0):
<putn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0xffffffff,%esi
mov    $0x0,%al
call   1030 <itoa@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putn>:
push   %rax
mov    $0xffffffff,%esi
xor    %eax,%eax
call   1030 <itoa@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @putn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @itoa to i32 (i32, i32, ...)*)(i32 %3, i32 -1)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @putn(i32 %0) {
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @itoa to i32 (i32, i32, ...)*)(i32 %0, i32 -1)
%3 = sext i32 %2 to i64
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int file_exists(char *filename) {
  FILE *f;
  f = fopen(filename, "rb");
  if (f != NULL) {
    fclose(f);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <file_exists+0x40>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x1,-0x4(%rbp)
jmp    1167 <file_exists+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
test   %rax,%rax
je     1141 <file_exists+0x21>
mov    %rax,%rdi
call   1030 <fclose@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define i32 @file_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i32* @fopen(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %6, i32** %4
%7 = load i32*, i32** %4
%8 = icmp ne i32* %7, null
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32*, i32** %4
%11 = call i32 @fclose(i32* %10)
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %9
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define i32 @file_exists(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @fclose(i32* %2)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int setCharacterSet(char const *);
int registerCharacterSet(const char *charset) {
  return setCharacterSet(charset);
}


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

x86 assembly (clang, -O2):
<registerCharacterSet>:
jmp    1030 <setCharacterSet@plt>

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

LLVM IR (-O2):
define i32 @registerCharacterSet(i8* %0) {
%2 = tail call i32 @setCharacterSet(i8* %0)
ret i32 %2
}
void caller_1_2_1_2_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_1_2_1_2_2_1_1() {
ret void
}
int isbacktick(int c) { return (c == '`'); }


x86 assembly (clang, -O0):
<isbacktick>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x60,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isbacktick>:
xor    %eax,%eax
cmp    $0x60,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isbacktick(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 96
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isbacktick(i32 %0) {
%2 = icmp eq i32 %0, 96
%3 = zext i1 %2 to i32
ret i32 %3
}
void batadv_mcast_free(struct batadv_priv *bat_priv) { return; }


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

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

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

LLVM IR (-O2):
%struct.batadv_priv = type opaque
define void @batadv_mcast_free(%struct.batadv_priv* nocapture %0) {
ret void
}
const char *GetClassDefaultsModeName(unsigned short mode) {
  const char *sname;
  switch (mode) {
  case 1:
    sname = "conservation";
    break;
  case 0:
    sname = "convenience";
    break;
  default:
    sname = "unknown";
    break;
  }
  return (sname);
}


x86 assembly (clang, -O0):
<GetClassDefaultsModeName>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     1140 <GetClassDefaultsModeName+0x40>
jmp    111f <GetClassDefaultsModeName+0x1f>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
jne    1150 <GetClassDefaultsModeName+0x50>
jmp    1130 <GetClassDefaultsModeName+0x30>
lea    0xec9(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    115b <GetClassDefaultsModeName+0x5b>
lea    0xec6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    115b <GetClassDefaultsModeName+0x5b>
lea    0xec2(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetClassDefaultsModeName>:
test   %edi,%edi
lea    0xf04(%rip),%rax
lea    0xf09(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x1,%di
lea    0xee1(%rip),%rax
cmovne %rcx,%rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"conservation\00"
@.str.1 = [12 x i8] c"convenience\00"
@.str.2 = [8 x i8] c"unknown\00"
define i8* @GetClassDefaultsModeName(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8*
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = zext i16 %4 to i32
switch i32 %5, label %8 [
i32 1, label %6
i32 0, label %7
]
6: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %3
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %9
9: ; preds = %8, %7, %6
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [13 x i8] c"conservation\00"
@.str.1 = [12 x i8] c"convenience\00"
@.str.2 = [8 x i8] c"unknown\00"
define i8* @GetClassDefaultsModeName(i16 zeroext %0) {
%2 = icmp eq i16 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0)
%4 = icmp eq i16 %0, 1
%5 = select i1 %4, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %3
ret i8* %5
}
/* Variables and functions */
double mysinfp(double);
double bar(double x) { return 1.0 + mysinfp(x); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <mysinfp@plt>
movaps %xmm0,%xmm1
movsd  0xece(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
call   1030 <mysinfp@plt>
addsd  0xee2(%rip),%xmm0
pop    %rax
ret

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

LLVM IR (-O2):
define double @bar(double %0) {
%2 = tail call double @mysinfp(double %0)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ SavePrefs();
void xIdeOn(void) { SavePrefs(); }


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

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

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

LLVM IR (-O2):
define void @xIdeOn() {
%1 = tail call i32 (...) @SavePrefs()
ret void
}
const struct genlist *server_list_base(const struct server_list *tthis) {
  return ((struct genlist *)(tthis));
}


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

x86 assembly (clang, -O2):
<server_list_base>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.genlist = type opaque
%struct.server_list = type opaque
define %struct.genlist* @server_list_base(%struct.server_list* %0) {
%2 = alloca %struct.server_list*
store %struct.server_list* %0, %struct.server_list** %2
%3 = load %struct.server_list*, %struct.server_list** %2
%4 = bitcast %struct.server_list* %3 to %struct.genlist*
ret %struct.genlist* %4
}

LLVM IR (-O2):
%struct.genlist = type opaque
%struct.server_list = type opaque
define %struct.genlist* @server_list_base(%struct.server_list* readnone %0) {
%2 = bitcast %struct.server_list* %0 to %struct.genlist*
ret %struct.genlist* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
size_t int8PackSize(const int8_t *data) { return sizeof(*data); }


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

x86 assembly (clang, -O2):
<int8PackSize>:
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i64 @int8PackSize(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
ret i64 4
}

LLVM IR (-O2):
define i64 @int8PackSize(i32* nocapture readnone %0) {
ret i64 4
}
/* Variables and functions */
int /*<<< orphan*/ call(char *);
sub() { call("ccsub"); }


x86 assembly (clang, -O0):
<sub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <call@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"ccsub\00"
define i32 @sub() {
%1 = alloca i32
%2 = call i32 @call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [6 x i8] c"ccsub\00"
define i32 @sub() {
%1 = tail call i32 @call(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint;

/* Variables and functions */
uint cpu_vec_exts() { return (0); }


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

x86 assembly (clang, -O2):
<cpu_vec_exts>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @cpu_vec_exts() {
ret i32 0
}

LLVM IR (-O2):
define i32 @cpu_vec_exts() {
ret i32 0
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ INIT_LIST_HEAD(struct list_head *);
int /*<<< orphan*/ list_del(struct list_head *);
void list_del_init(struct list_head *entry) {
  list_del(entry);
  INIT_LIST_HEAD(entry);
}


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

x86 assembly (clang, -O2):
<list_del_init>:
push   %rbx
mov    %rdi,%rbx
call   1030 <list_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <INIT_LIST_HEAD@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_del_init(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
%3 = load %struct.list_head*, %struct.list_head** %2
%4 = call i32 @list_del(%struct.list_head* %3)
%5 = load %struct.list_head*, %struct.list_head** %2
%6 = call i32 @INIT_LIST_HEAD(%struct.list_head* %5)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_del_init(%struct.list_head* %0) {
%2 = tail call i32 @list_del(%struct.list_head* %0)
%3 = tail call i32 @INIT_LIST_HEAD(%struct.list_head* %0)
ret void
}
void NormalizeWord(char *word) {
  int i = 0;
  while (word[i]) {
    if (word[i] < 91 && word[i] > 64)
      word[i] += 32;
    i++;
  }
}


x86 assembly (clang, -O0):
<NormalizeWord>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     116b <NormalizeWord+0x6b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5b,%eax
jge    115d <NormalizeWord+0x5d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x40,%eax
jle    115d <NormalizeWord+0x5d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edx
add    $0x20,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <NormalizeWord+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<NormalizeWord>:
mov    (%rdi),%al
test   %al,%al
je     112a <NormalizeWord+0x2a>
add    $0x1,%rdi
jmp    111b <NormalizeWord+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <NormalizeWord+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <NormalizeWord+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <NormalizeWord+0x10>
ret

LLVM IR (-O0):
define void @NormalizeWord(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %36, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = icmp ne i8 %9, 0
br i1 %10, label %11, label %39
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp slt i32 %17, 91
br i1 %18, label %19, label %36
19: ; preds = %11
%20 = load i8*, i8** %2
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
%24 = load i8, i8* %23
%25 = sext i8 %24 to i32
%26 = icmp sgt i32 %25, 64
br i1 %26, label %27, label %36
27: ; preds = %19
%28 = load i8*, i8** %2
%29 = load i32, i32* %3
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = add nsw i32 %33, 32
%35 = trunc i32 %34 to i8
store i8 %35, i8* %31
br label %36
36: ; preds = %27, %19, %11
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
br label %4
39: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @NormalizeWord(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %12
%5 = phi i64 [ %13, %12 ], [ 0, %1 ]
%6 = phi i8 [ %15, %12 ], [ %2, %1 ]
%7 = phi i8* [ %14, %12 ], [ %0, %1 ]
%8 = add i8 %6, -65
%9 = icmp ult i8 %8, 26
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = add nuw nsw i8 %6, 32
store i8 %11, i8* %7
br label %12
12: ; preds = %10, %4
%13 = add nuw i64 %5, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %12, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fputc(int /*<<< orphan*/, char);
void putchar(char c) { fputc(0, c); }


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %edi,%edi
movsbl -0x1(%rbp),%esi
call   1030 <fputc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
mov    %edi,%esi
xor    %edi,%edi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @putchar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @fputc(i32 0, i8 signext %3)
ret void
}

LLVM IR (-O2):
define void @putchar(i8 signext %0) {
%2 = tail call i32 @fputc(i32 0, i8 signext %0)
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int le2int(unsigned char *buf) {
  int32_t res = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0];
  return res;
}


x86 assembly (clang, -O0):
<le2int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le2int>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @le2int(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 3
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = shl i32 %7, 24
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = shl i32 %12, 16
%14 = or i32 %8, %13
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = or i32 %14, %19
%21 = load i8*, i8** %2
%22 = getelementptr inbounds i8, i8* %21, i64 0
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = or i32 %20, %24
store i32 %25, i32* %3
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @le2int(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl nuw i32 %4, 24
%6 = getelementptr inbounds i8, i8* %0, i64 2
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 16
%10 = or i32 %9, %5
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = shl nuw nsw i32 %13, 8
%15 = or i32 %10, %14
%16 = load i8, i8* %0
%17 = zext i8 %16 to i32
%18 = or i32 %15, %17
ret i32 %18
}
unsigned char f16(unsigned char x, long int y) {
  return (x << y) | (x >> ((-y) & (8 * sizeof(unsigned char) - 1)));
}


x86 assembly (clang, -O0):
<f16>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x10(%rbp),%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x7,%rcx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f16>:
mov    %rsi,%rcx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
and    $0x7,%cl
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f16(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = shl i32 %6, %8
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = load i64, i64* %4
%13 = sub nsw i64 0, %12
%14 = and i64 %13, 7
%15 = trunc i64 %14 to i32
%16 = ashr i32 %11, %15
%17 = or i32 %9, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @f16(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %3, %4
%6 = sub i32 0, %4
%7 = and i32 %6, 7
%8 = lshr i32 %3, %7
%9 = or i32 %8, %5
%10 = trunc i32 %9 to i8
ret i8 %10
}
/* Type definitions */
struct tm {
  int dummy;
};
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ rtc_write_from_struct(struct tm *);
__attribute__((used)) int _settimeofday(struct timeval *tp, void *tzp) {
  if (tp) {
    struct tm *timeinfo = localtime(&(tp->tv_sec));
    rtc_write_from_struct(timeinfo);
  }
  return 0;
}


x86 assembly (clang, -O0):
<_settimeofday>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1151 <_settimeofday+0x31>
mov    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <rtc_write_from_struct@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_settimeofday>:
test   %rdi,%rdi
je     1137 <_settimeofday+0x17>
push   %rax
call   1030 <localtime@plt>
mov    %rax,%rdi
call   1040 <rtc_write_from_struct@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
%struct.tm = type { i32 }
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.timeval*, i8*)* @_settimeofday to i8*)], section "llvm.metadata"
define i32 @_settimeofday(%struct.timeval* %0, i8* %1) {
%3 = alloca %struct.timeval*
%4 = alloca i8*
%5 = alloca %struct.tm*
store %struct.timeval* %0, %struct.timeval** %3
store i8* %1, i8** %4
%6 = load %struct.timeval*, %struct.timeval** %3
%7 = icmp ne %struct.timeval* %6, null
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load %struct.timeval*, %struct.timeval** %3
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %9, i32 0, i32 0
%11 = call %struct.tm* @localtime(i32* %10)
store %struct.tm* %11, %struct.tm** %5
%12 = load %struct.tm*, %struct.tm** %5
%13 = call i32 @rtc_write_from_struct(%struct.tm* %12)
br label %14
14: ; preds = %8, %2
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
%struct.tm = type { i32 }
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (i32 (%struct.timeval*, i8*)* @_settimeofday to i8*)], section "llvm.metadata"
define i32 @_settimeofday(%struct.timeval* %0, i8* nocapture readnone %1) {
%3 = icmp eq %struct.timeval* %0, null
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %0, i64 0, i32 0
%6 = tail call %struct.tm* @localtime(i32* %5)
%7 = tail call i32 @rtc_write_from_struct(%struct.tm* %6)
br label %8
8: ; preds = %4, %2
ret i32 0
}
int issquare(int n) {
  int i;
  for (i = 2; i < 10000; ++i) {
    if ((i * i) == n)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<issquare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jge    114a <issquare+0x4a>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    1137 <issquare+0x37>
movl   $0x1,-0x4(%rbp)
jmp    1151 <issquare+0x51>
jmp    113c <issquare+0x3c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <issquare+0xe>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<issquare>:
mov    $0x3,%ecx
mov    $0x1,%eax
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rcx),%edx
imul   %edx,%edx
cmp    %edi,%edx
je     1130 <issquare+0x30>
mov    %ecx,%edx
imul   %ecx,%edx
cmp    %edi,%edx
je     1130 <issquare+0x30>
add    $0x2,%ecx
cmp    $0x2711,%ecx
jne    1110 <issquare+0x10>
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @issquare(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 2, i32* %4
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 10000
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32, i32* %4
%10 = load i32, i32* %4
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %3
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %8
store i32 1, i32* %2
br label %20
15: ; preds = %8
br label %16
16: ; preds = %15
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
store i32 0, i32* %2
br label %20
20: ; preds = %19, %14
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @issquare(i32 %0) {
br label %9
2: ; preds = %9
%3 = or i32 %10, 1
%4 = mul nuw nsw i32 %3, %3
%5 = icmp eq i32 %4, %0
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = add nuw nsw i32 %10, 2
%8 = icmp eq i32 %7, 10000
br i1 %8, label %13, label %9
9: ; preds = %6, %1
%10 = phi i32 [ 2, %1 ], [ %7, %6 ]
%11 = mul nuw nsw i32 %10, %10
%12 = icmp eq i32 %11, %0
br i1 %12, label %13, label %2
13: ; preds = %6, %2, %9
%14 = phi i32 [ 1, %9 ], [ 1, %2 ], [ 0, %6 ]
ret i32 %14
}
int test_imm_5Dint16_reg(short val) {
  return ((val) & (0x5D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_5Dint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x5d,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_5Dint16_reg>:
test   $0x5d,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Dint16_reg(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = sext i16 %3 to i32
%5 = and i32 %4, 93
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_5Dint16_reg(i16 signext %0) {
%2 = and i16 %0, 93
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int strlen(char *);
int main(void) {
  char str[80];
  gets(str);
  puts(str);
  printf("The length of input string is: %d\n", strlen(str));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
call   1060 <gets@plt>
lea    -0x60(%rbp),%rdi
call   1030 <puts@plt>
lea    -0x60(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%esi
lea    0xe8d(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0xe99(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"The length of input string is: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%4 = call i32 @gets(i8* %3)
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%6 = call i32 @puts(i8* %5)
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"The length of input string is: %d\0A\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
%4 = call i32 @puts(i8* %2)
%5 = call i32 @strlen(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
size_t list_meter_int16_t(const void *el) {
  if (el) {
  }
  return sizeof(int16_t);
}


x86 assembly (clang, -O0):
<list_meter_int16_t>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1118 <list_meter_int16_t+0x18>
jmp    1118 <list_meter_int16_t+0x18>
mov    $0x4,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_meter_int16_t>:
mov    $0x4,%eax
ret

LLVM IR (-O0):
define i64 @list_meter_int16_t(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %6
6: ; preds = %5, %1
ret i64 4
}

LLVM IR (-O2):
define i64 @list_meter_int16_t(i8* nocapture readnone %0) {
ret i64 4
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
main() {
  int x;
  int *p = &x;
  while (x < 100) {
    (*p)++;
  }
  assert(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x64,-0x8(%rbp)
jge    1141 <main+0x31>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1127 <main+0x17>
xor    %edi,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32* %2, i32** %3
br label %4
4: ; preds = %7, %0
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 100
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1
store i32 %10, i32* %8
br label %4
11: ; preds = %4
%12 = call i32 @assert(i32 0)
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @assert(i32 0)
ret i32 0
}
void plat_finish(void) {}


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

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

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

LLVM IR (-O2):
define void @plat_finish() {
ret void
}
/* Type definitions */
struct _Locale_name_hint {
  int dummy;
};

/* Variables and functions */
char const *_Locale_extract_name(char const *, int *);
char const *_Locale_extract_monetary_name(const char *name,
                                          char *buf __attribute__((__unused__)),
                                          struct _Locale_name_hint *hint
                                          __attribute__((__unused__)),
                                          int *__err_code) {
  return _Locale_extract_name(name, __err_code);
}


x86 assembly (clang, -O0):
<_Locale_extract_monetary_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <_Locale_extract_name@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Locale_extract_monetary_name>:
mov    %rcx,%rsi
jmp    1030 <_Locale_extract_name@plt>

LLVM IR (-O0):
%struct._Locale_name_hint = type { i32 }
define i8* @_Locale_extract_monetary_name(i8* %0, i8* %1, %struct._Locale_name_hint* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca %struct._Locale_name_hint*
%8 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store %struct._Locale_name_hint* %2, %struct._Locale_name_hint** %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = load i32*, i32** %8
%11 = call i8* @_Locale_extract_name(i8* %9, i32* %10)
ret i8* %11
}

LLVM IR (-O2):
%struct._Locale_name_hint = type { i32 }
define i8* @_Locale_extract_monetary_name(i8* %0, i8* nocapture readnone %1, %struct._Locale_name_hint* nocapture readnone %2, i32* %3) {
%5 = tail call i8* @_Locale_extract_name(i8* %0, i32* %3)
ret i8* %5
}
int main(int argc, const char *argv[]) {
  struct {
    int a;
    float b;
    double c;
  } x, y;
  y = x;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.anon = type { i32, float, double }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.anon
%7 = alloca %struct.anon
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast %struct.anon* %7 to i8*
%9 = bitcast %struct.anon* %6 to i8*
ret i32 0
}

LLVM IR (-O2):
%struct.anon = type { i32, float, double }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
unsigned long PRCMHIBRegRead(int);
unsigned long PRCMOCRRegisterRead(unsigned char ucIndex) {
  return PRCMHIBRegRead(0x4402F800 + 0x00000420 + (ucIndex << 2));
}


x86 assembly (clang, -O0):
<PRCMOCRRegisterRead>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
shl    $0x2,%edi
add    $0x4402fc20,%edi
call   1030 <PRCMHIBRegRead@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PRCMOCRRegisterRead>:
lea    0x4402fc20(,%rdi,4),%edi
jmp    1030 <PRCMHIBRegRead@plt>

LLVM IR (-O0):
define i64 @PRCMOCRRegisterRead(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = shl i32 %4, 2
%6 = add nsw i32 1141046304, %5
%7 = call i64 @PRCMHIBRegRead(i32 %6)
ret i64 %7
}

LLVM IR (-O2):
define i64 @PRCMOCRRegisterRead(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = shl nuw nsw i32 %2, 2
%4 = add nuw nsw i32 %3, 1141046304
%5 = tail call i64 @PRCMHIBRegRead(i32 %4)
ret i64 %5
}
/* Type definitions */
struct snis_device_io_connection {
  int dummy;
};
typedef int /*<<< orphan*/ con;

/* Variables and functions */
int /*<<< orphan*/ free(struct snis_device_io_connection *);
int /*<<< orphan*/ memset(struct snis_device_io_connection *,
                          int /*<<< orphan*/, int);
void snis_device_io_shutdown(struct snis_device_io_connection *con) {
  memset(con, 0, sizeof(con));
  free(con);
}


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

x86 assembly (clang, -O2):
<snis_device_io_shutdown>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.snis_device_io_connection = type { i32 }
define void @snis_device_io_shutdown(%struct.snis_device_io_connection* %0) {
%2 = alloca %struct.snis_device_io_connection*
store %struct.snis_device_io_connection* %0, %struct.snis_device_io_connection** %2
%3 = load %struct.snis_device_io_connection*, %struct.snis_device_io_connection** %2
%4 = call i32 @memset(%struct.snis_device_io_connection* %3, i32 0, i32 8)
%5 = load %struct.snis_device_io_connection*, %struct.snis_device_io_connection** %2
%6 = call i32 @free(%struct.snis_device_io_connection* %5)
ret void
}

LLVM IR (-O2):
%struct.snis_device_io_connection = type { i32 }
define void @snis_device_io_shutdown(%struct.snis_device_io_connection* %0) {
%2 = tail call i32 @memset(%struct.snis_device_io_connection* %0, i32 0, i32 8)
%3 = tail call i32 @free(%struct.snis_device_io_connection* %0)
ret void
}
void _emptyExtraDataDestructor(void *data) { (void)data; }


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

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

LLVM IR (-O0):
define void @_emptyExtraDataDestructor(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
ret void
}

LLVM IR (-O2):
define void @_emptyExtraDataDestructor(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int store_dobldobl_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(641, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<store_dobldobl_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x281,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<store_dobldobl_solutions>:
mov    $0x281,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @store_dobldobl_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 641, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @store_dobldobl_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 641, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ Frame2Time(unsigned int, int *, int *, int *);
void HSG2Time(unsigned hsg, int *Min, int *Sec, int *Fra) {
  Frame2Time(hsg + 150, Min, Sec, Fra);
}


x86 assembly (clang, -O0):
<HSG2Time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
add    $0x96,%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <Frame2Time@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<HSG2Time>:
add    $0x96,%edi
jmp    1030 <Frame2Time@plt>

LLVM IR (-O0):
define void @HSG2Time(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = add i32 %9, 150
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32*, i32** %8
%14 = call i32 @Frame2Time(i32 %10, i32* %11, i32* %12, i32* %13)
ret void
}

LLVM IR (-O2):
define void @HSG2Time(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = add i32 %0, 150
%6 = tail call i32 @Frame2Time(i32 %5, i32* %1, i32* %2, i32* %3)
ret void
}
void InterpolateRow_Any_AVX2() {}


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

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

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

LLVM IR (-O2):
define void @InterpolateRow_Any_AVX2() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ visuals;
};
typedef TYPE_1__ Depth;

/* Variables and functions */
void *get_Depth_visuals(void *_p) { return (void *)((Depth *)_p)->visuals; }


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

x86 assembly (clang, -O2):
<get_Depth_visuals>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i8* @get_Depth_visuals(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = inttoptr i64 %6 to i8*
ret i8* %7
}

LLVM IR (-O2):
define i8* @get_Depth_visuals(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
int mb_atomic_get_int(volatile int *var) {
  int ret;
  asm volatile("lock ;"
               " cmpxchgl %0, %1 \n\t"
               : "=a"(ret)
               : "m"(*var)
               : "cc", "memory");
  return ret;
}


x86 assembly (clang, -O0):
<mb_atomic_get_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
lock cmpxchg %eax,(%rax)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mb_atomic_get_int>:
lock cmpxchg %eax,(%rdi)
ret

LLVM IR (-O0):
define i32 @mb_atomic_get_int(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 asm sideeffect "lock ; cmpxchgl $0, $1 \0A\09", "={ax},*m,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @mb_atomic_get_int(i32* %0) {
%2 = tail call i32 asm sideeffect "lock ; cmpxchgl $0, $1 \0A\09", "={ax},*m,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %0)
ret i32 %2
}
/* Variables and functions */
int geteuid();
int /*<<< orphan*/ printf(char *);
int main() {
  int uid_t = geteuid();
  if (uid_t > 0) {
    printf("You're not using sudo!\n");
  } else {
    printf("You're using sudo!\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1154 <main+0x34>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
jmp    1160 <main+0x40>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <geteuid@plt>
test   %eax,%eax
lea    0xee2(%rip),%rax
lea    0xec8(%rip),%rdi
cmovg  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"You're not using sudo!\0A\00"
@.str.1 = [20 x i8] c"You're using sudo!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @geteuid()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
@str = [19 x i8] c"You're using sudo!\00"
@str.2 = [23 x i8] c"You're not using sudo!\00"
define i32 @main() {
%1 = tail call i32 (...) @geteuid()
%2 = icmp sgt i32 %1, 0
%3 = select i1 %2, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0)
%4 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 0
}
/* Variables and functions */
char const *tst_acquire_device_(void (*)(), int /*<<< orphan*/);
const char *tst_acquire_device(void(cleanup_fn)(void)) {
  return tst_acquire_device_(cleanup_fn, 0);
}


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

x86 assembly (clang, -O2):
<tst_acquire_device>:
xor    %esi,%esi
jmp    1030 <tst_acquire_device_@plt>

LLVM IR (-O0):
define i8* @tst_acquire_device(void ()* %0) {
%2 = alloca void ()*
store void ()* %0, void ()** %2
%3 = load void ()*, void ()** %2
%4 = bitcast void ()* %3 to void (...)*
%5 = call i8* @tst_acquire_device_(void (...)* %4, i32 0)
ret i8* %5
}

LLVM IR (-O2):
define i8* @tst_acquire_device(void ()* %0) {
%2 = bitcast void ()* %0 to void (...)*
%3 = tail call i8* @tst_acquire_device_(void (...)* %2, i32 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ ENAMETOOLONG;
int /*<<< orphan*/ errno;
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int __gethostname(char *name, size_t len) {
  static const char hostname[] = "naclhost";
  int result = 0;
  size_t copy = sizeof hostname;
  if (len < copy) {
    errno = ENAMETOOLONG;
    result = -1;
    copy = len;
  }
  memcpy(name, hostname, copy);
  return result;
}


x86 assembly (clang, -O0):
<__gethostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x9,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    115e <__gethostname+0x4e>
mov    0x2e94(%rip),%rax
mov    (%rax),%ecx
mov    0x2e93(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
lea    0xe93(%rip),%rsi
call   1030 <memcpy@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__gethostname>:
push   %rbx
cmp    $0x8,%rsi
ja     1133 <__gethostname+0x23>
mov    %rsi,%rdx
mov    0x2eb7(%rip),%rax
mov    (%rax),%eax
mov    0x2eb6(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%ebx
jmp    113a <__gethostname+0x2a>
mov    $0x9,%edx
xor    %ebx,%ebx
lea    0xebf(%rip),%rsi
call   1030 <memcpy@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__gethostname.hostname = internal constant [9 x i8] c"naclhost\00"
@ENAMETOOLONG = global i32 0
@errno = global i32 0
define i32 @__gethostname(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32
%6 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
store i32 0, i32* %5
store i64 9, i64* %6
%7 = load i64, i64* %4
%8 = load i64, i64* %6
%9 = icmp ult i64 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @ENAMETOOLONG
store i32 %11, i32* @errno
store i32 -1, i32* %5
%12 = load i64, i64* %4
store i64 %12, i64* %6
br label %13
13: ; preds = %10, %2
%14 = load i8*, i8** %3
%15 = load i64, i64* %6
%16 = call i32 @memcpy(i8* %14, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__gethostname.hostname, i64 0, i64 0), i64 %15)
%17 = load i32, i32* %5
ret i32 %17
}

LLVM IR (-O2):
@__gethostname.hostname = internal constant [9 x i8] c"naclhost\00"
@ENAMETOOLONG = global i32 0
@errno = global i32 0
define i32 @__gethostname(i8* %0, i64 %1) {
%3 = icmp ult i64 %1, 9
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32, i32* @ENAMETOOLONG
store i32 %5, i32* @errno
br label %6
6: ; preds = %4, %2
%7 = phi i32 [ -1, %4 ], [ 0, %2 ]
%8 = phi i64 [ %1, %4 ], [ 9, %2 ]
%9 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @__gethostname.hostname, i64 0, i64 0), i64 %8)
ret i32 %7
}