xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ is_lws(char const);
char *skip_lws(const char *s, int sz) {
  while (sz > 0 && is_lws(*s)) {
    s++;
    sz--;
  }
  return (char *)s;
}


x86 assembly (clang, -O0):
<skip_lws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    1144 <skip_lws+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_lws@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1154 <skip_lws+0x44>
jmp    116e <skip_lws+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <skip_lws+0xf>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_lws>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
test   %esi,%esi
jle    1139 <skip_lws+0x29>
mov    %esi,%ebp
add    $0x1,%ebp
nop
movsbl (%rbx),%edi
call   1030 <is_lws@plt>
test   %rax,%rax
je     1139 <skip_lws+0x29>
add    $0x1,%rbx
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
jg     1120 <skip_lws+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @skip_lws(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %15, %2
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = call i64 @is_lws(i8 signext %10)
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %8, %5
%14 = phi i1 [ false, %5 ], [ %12, %8 ]
br i1 %14, label %15, label %20
15: ; preds = %13
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %3
%18 = load i32, i32* %4
%19 = add nsw i32 %18, -1
store i32 %19, i32* %4
br label %5
20: ; preds = %13
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
define i8* @skip_lws(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2, %10
%5 = phi i32 [ %12, %10 ], [ %1, %2 ]
%6 = phi i8* [ %11, %10 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = tail call i64 @is_lws(i8 signext %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %4
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = add nsw i32 %5, -1
%13 = icmp sgt i32 %5, 1
br i1 %13, label %4, label %14
14: ; preds = %4, %10, %2
%15 = phi i8* [ %0, %2 ], [ %11, %10 ], [ %6, %4 ]
ret i8* %15
}
/* Type definitions */
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ memcpy(float *, float *, int);
int /*<<< orphan*/ memset(float *, int /*<<< orphan*/, int);
float __attribute__((no)) stress_funcret_float1(float a) {
  float b;
  (void)memcpy(&b, &a, sizeof(a));
  (void)memset(&a, 0, sizeof(a));
  return b;
}


x86 assembly (clang, -O0):
<stress_funcret_float1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
lea    -0x4(%rbp),%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_funcret_float1>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
movss  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @stress_funcret_float1(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = call i32 @memcpy(float* %3, float* %2, i32 4)
%5 = call i32 @memset(float* %2, i32 0, i32 4)
%6 = load float, float* %3
ret float %6
}

LLVM IR (-O2):
define float @stress_funcret_float1(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = bitcast float* %3 to i8*
%5 = call i32 @memcpy(float* %3, float* %2, i32 4)
%6 = call i32 @memset(float* %2, i32 0, i32 4)
%7 = load float, float* %3
ret float %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: bandwidth [--slow] [--fast] [--faster] [--fastest] [--limit] "
         "[--title string] [--csv file] [--nice]\n");
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [108 x i8] c"Usage: bandwidth [--slow] [--fast] [--faster] [--fastest] [--limit] [--title string] [--csv file] [--nice]\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([108 x i8], [108 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [107 x i8] c"Usage: bandwidth [--slow] [--fast] [--faster] [--fastest] [--limit] [--title string] [--csv file] [--nice]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([107 x i8], [107 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ testBitWiseNot(int, int, int, int);
int /*<<< orphan*/ testBooleanNot(int, int, int, int);
int main() {
  testBitWiseNot(1, 2, -3, 5);
  testBooleanNot(1, 2, -3, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0xfffffffd,%edx
mov    $0x5,%ecx
call   1030 <testBitWiseNot@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0xfffffffd,%edx
mov    $0x5,%ecx
call   1040 <testBooleanNot@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0xfffffffd,%edx
mov    $0x5,%ecx
call   1030 <testBitWiseNot@plt>
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0xfffffffd,%edx
mov    $0x5,%ecx
call   1040 <testBooleanNot@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @testBitWiseNot(i32 1, i32 2, i32 -3, i32 5)
%3 = call i32 @testBooleanNot(i32 1, i32 2, i32 -3, i32 5)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @testBitWiseNot(i32 1, i32 2, i32 -3, i32 5)
%2 = tail call i32 @testBooleanNot(i32 1, i32 2, i32 -3, i32 5)
ret i32 0
}
/* Type definitions */
struct stat {
  scalar_t__ st_size;
};

/* Variables and functions */
int /*<<< orphan*/ stat(char *, struct stat *);
long double file_size(char *fp) {
  struct stat st;
  stat(fp, &st);
  return (long double)st.st_size;
}


x86 assembly (clang, -O0):
<file_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
fildll -0x18(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_size>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rsi
call   1030 <stat@plt>
mov    0x10(%rsp),%rax
mov    %rax,0x8(%rsp)
fildll 0x8(%rsp)
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define x86_fp80 @file_size(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to x86_fp80
ret x86_fp80 %8
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define x86_fp80 @file_size(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to x86_fp80
ret x86_fp80 %7
}
/* Variables and functions */
scalar_t__ close(int);
int conn_close(int conn) {
  if (close(conn) < 0) {
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<conn_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0x0,%rax
jge    1139 <conn_close+0x29>
movl   $0xffffffff,-0x4(%rbp)
jmp    1140 <conn_close+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<conn_close>:
push   %rax
call   1030 <close@plt>
sar    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @conn_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @close(i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @conn_close(i32 %0) {
%2 = tail call i64 @close(i32 %0)
%3 = ashr i64 %2, 63
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ RETI(int, int);
int /*<<< orphan*/ T_WAIT_UNTIL(int);
void op_ED_0x7d(void) {
  RETI(4, 7);
  T_WAIT_UNTIL(10);
  return;
}


x86 assembly (clang, -O0):
<op_ED_0x7d>:
push   %rbp
mov    %rsp,%rbp
mov    $0x4,%edi
mov    $0x7,%esi
call   1040 <RETI@plt>
mov    $0xa,%edi
call   1030 <T_WAIT_UNTIL@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_ED_0x7d>:
push   %rax
mov    $0x4,%edi
mov    $0x7,%esi
call   1040 <RETI@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <T_WAIT_UNTIL@plt>

LLVM IR (-O0):
define void @op_ED_0x7d() {
%1 = call i32 @RETI(i32 4, i32 7)
%2 = call i32 @T_WAIT_UNTIL(i32 10)
ret void
}

LLVM IR (-O2):
define void @op_ED_0x7d() {
%1 = tail call i32 @RETI(i32 4, i32 7)
%2 = tail call i32 @T_WAIT_UNTIL(i32 10)
ret void
}
/* Variables and functions */
int __wasilibc_main(int, char **);
__attribute__((weak, nodebug)) int __main_argc_argv(int argc, char *argv[]) {
  return __wasilibc_main(argc, argv);
}


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

x86 assembly (clang, -O2):
<__main_argc_argv>:
jmp    1030 <__wasilibc_main@plt>

LLVM IR (-O0):
define weak i32 @__main_argc_argv(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 = load i8**, i8*** %4
%7 = call i32 @__wasilibc_main(i32 %5, i8** %6)
ret i32 %7
}

LLVM IR (-O2):
define weak i32 @__main_argc_argv(i32 %0, i8** %1) {
%3 = tail call i32 @__wasilibc_main(i32 %0, i8** %1)
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int strlen(char *);
char tolower(char);
int cmin(char *chain) {
  int i;
  for (i = 0; i < strlen(chain); i++) {
    chain[i] = tolower(chain[i]);
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<cmin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <cmin+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <tolower@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <cmin+0x13>
mov    0x2e5e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmin>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
test   %eax,%eax
jle    1161 <cmin+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1040 <tolower@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <cmin+0x20>
mov    0x2e78(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @cmin(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %20, %1
%5 = load i32, i32* %3
%6 = load i8*, i8** %2
%7 = call i32 @strlen(i8* %6)
%8 = icmp slt i32 %5, %7
br i1 %8, label %9, label %23
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8, i8* %13
%15 = call signext i8 @tolower(i8 signext %14)
%16 = load i8*, i8** %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
store i8 %15, i8* %19
br label %20
20: ; preds = %9
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %4
23: ; preds = %4
%24 = load i32, i32* @EXIT_SUCCESS
ret i32 %24
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @cmin(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @tolower(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}
/* Variables and functions */
float ran4(unsigned long *);
float nthRan4(unsigned long n) {
  unsigned long l = n;
  return (ran4(&l));
}


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

x86 assembly (clang, -O2):
<nthRan4>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rdi
call   1030 <ran4@plt>
pop    %rax
ret

LLVM IR (-O0):
define float @nthRan4(i64 %0) {
%2 = alloca i64
%3 = alloca i64
store i64 %0, i64* %2
%4 = load i64, i64* %2
store i64 %4, i64* %3
%5 = call float @ran4(i64* %3)
ret float %5
}

LLVM IR (-O2):
define float @nthRan4(i64 %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 %0, i64* %2
%4 = call float @ran4(i64* %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ gui_color_init_pairs_terminal();
int /*<<< orphan*/ gui_color_init_vars();
int /*<<< orphan*/ gui_color_init_weechat();
int /*<<< orphan*/ gui_color_palette_build_aliases();
scalar_t__ has_colors();
int /*<<< orphan*/ start_color();
int /*<<< orphan*/ use_default_colors();
void gui_color_alloc() {
  if (has_colors()) {
    start_color();
    use_default_colors();
  }
  gui_color_init_vars();
  gui_color_init_pairs_terminal();
  gui_color_init_weechat();
  gui_color_palette_build_aliases();
}


x86 assembly (clang, -O0):
<gui_color_alloc>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <has_colors@plt>
cmp    $0x0,%rax
je     1193 <gui_color_alloc+0x23>
mov    $0x0,%al
call   1070 <start_color@plt>
mov    $0x0,%al
call   1040 <use_default_colors@plt>
mov    $0x0,%al
call   1080 <gui_color_init_vars@plt>
mov    $0x0,%al
call   1060 <gui_color_init_pairs_terminal@plt>
mov    $0x0,%al
call   1090 <gui_color_init_weechat@plt>
mov    $0x0,%al
call   1030 <gui_color_palette_build_aliases@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gui_color_alloc>:
push   %rax
xor    %eax,%eax
call   1050 <has_colors@plt>
test   %rax,%rax
je     118b <gui_color_alloc+0x1b>
xor    %eax,%eax
call   1070 <start_color@plt>
xor    %eax,%eax
call   1040 <use_default_colors@plt>
xor    %eax,%eax
call   1080 <gui_color_init_vars@plt>
xor    %eax,%eax
call   1060 <gui_color_init_pairs_terminal@plt>
xor    %eax,%eax
call   1090 <gui_color_init_weechat@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <gui_color_palette_build_aliases@plt>

LLVM IR (-O0):
define void @gui_color_alloc() {
%1 = call i64 (...) @has_colors()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 (...) @start_color()
%5 = call i32 (...) @use_default_colors()
br label %6
6: ; preds = %3, %0
%7 = call i32 (...) @gui_color_init_vars()
%8 = call i32 (...) @gui_color_init_pairs_terminal()
%9 = call i32 (...) @gui_color_init_weechat()
%10 = call i32 (...) @gui_color_palette_build_aliases()
ret void
}

LLVM IR (-O2):
define void @gui_color_alloc() {
%1 = tail call i64 (...) @has_colors()
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 (...) @start_color()
%5 = tail call i32 (...) @use_default_colors()
br label %6
6: ; preds = %3, %0
%7 = tail call i32 (...) @gui_color_init_vars()
%8 = tail call i32 (...) @gui_color_init_pairs_terminal()
%9 = tail call i32 (...) @gui_color_init_weechat()
%10 = tail call i32 (...) @gui_color_palette_build_aliases()
ret void
}
/* Variables and functions */
int __WORDSIZE;
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int size = ((int)((sizeof(void *) * 3) / sizeof(char) - 1));
  printf("%d bits: %d bytes de comprimento\n", __WORDSIZE, size);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x17,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%esi
mov    -0x4(%rbp),%edx
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xedf(%rip),%rdi
mov    $0x17,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [34 x i8] c"%d bits: %d bytes de comprimento\0A\00"
@__WORDSIZE = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 23, i32* %1
%2 = load i32, i32* @__WORDSIZE
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"%d bits: %d bytes de comprimento\0A\00"
@__WORDSIZE = global i32 0
define i32 @main() {
%1 = load i32, i32* @__WORDSIZE
%2 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %1, i32 23)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scheduler_enter();
int gthread_yield(void) {
  scheduler_enter();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gthread_yield() {
%1 = call i32 (...) @scheduler_enter()
ret i32 0
}

LLVM IR (-O2):
define i32 @gthread_yield() {
%1 = tail call i32 (...) @scheduler_enter()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ Fork(int /*<<< orphan*/);
pid_t pm_fork_permanent(void) { return Fork(0); }


x86 assembly (clang, -O0):
<pm_fork_permanent>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <Fork@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_fork_permanent>:
xor    %edi,%edi
jmp    1030 <Fork@plt>

LLVM IR (-O0):
define i32 @pm_fork_permanent() {
%1 = call i32 @Fork(i32 0)
ret i32 %1
}

LLVM IR (-O2):
define i32 @pm_fork_permanent() {
%1 = tail call i32 @Fork(i32 0)
ret i32 %1
}
void *StrDup(char *str) {
  char *cp = strdup(str);
  if (!cp)
    error("Out of memory");
  return cp;
}


x86 assembly (clang, -O0):
<StrDup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1152 <StrDup+0x32>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<StrDup>:
push   %rbx
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113c <StrDup+0x1c>
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Out of memory\00"
define i8* @StrDup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"Out of memory\00"
define i8* @StrDup(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ isalpha(char);
int /*<<< orphan*/ printf(char *);
char tolower(char);
int again(void) {
  char input;
  printf("\nDo you want to play again? (y/n) ");
  while (!isalpha(input = getchar()))
    ;
  if (tolower(input) != 'n')
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<again>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%edi
call   1060 <isalpha@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    117b <again+0x3b>
jmp    1180 <again+0x40>
jmp    1154 <again+0x14>
movsbl -0x5(%rbp),%edi
call   1050 <tolower@plt>
movsbl %al,%eax
cmp    $0x6e,%eax
je     11a1 <again+0x61>
movl   $0x1,-0x4(%rbp)
jmp    11a8 <again+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<again>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1060 <isalpha@plt>
test   %eax,%eax
je     1150 <again+0x10>
mov    %ebx,%edi
call   1050 <tolower@plt>
xor    %ecx,%ecx
cmp    $0x6e,%al
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"\0ADo you want to play again? (y/n) \00"
define i32 @again() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %9, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = call i32 @isalpha(i8 signext %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
%11 = load i8, i8* %2
%12 = call signext i8 @tolower(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 110
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %1
br label %17
16: ; preds = %10
store i32 0, i32* %1
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [35 x i8] c"\0ADo you want to play again? (y/n) \00"
define i32 @again() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = tail call i32 @isalpha(i8 signext %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call signext i8 @tolower(i8 signext %3)
%8 = icmp ne i8 %7, 110
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void uint16_to_b2_LE(uint32_t data, uint8_t *b) {
  b[1] = (data >> 8) & 0xFF;
  b[0] = data & 0xFF;
}


x86 assembly (clang, -O0):
<uint16_to_b2_LE>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint16_to_b2_LE>:
mov    %edi,%eax
movzbl %ah,%ecx
mov    %ecx,0x4(%rsi)
movzbl %al,%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @uint16_to_b2_LE(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 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 1
store i32 %7, i32* %9
%10 = load i32, i32* %3
%11 = and i32 %10, 255
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 %11, i32* %13
ret void
}

LLVM IR (-O2):
define void @uint16_to_b2_LE(i32 %0, i32* nocapture writeonly %1) {
%3 = lshr i32 %0, 8
%4 = and i32 %3, 255
%5 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %4, i32* %5
%6 = and i32 %0, 255
store i32 %6, i32* %1
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t conv_endian(uint32_t x) {
  return (x << 24) + ((x & 0xff00) << 8) + ((x & 0xff0000) >> 8) + (x >> 24);
}


x86 assembly (clang, -O0):
<conv_endian>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x8,%ecx
add    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<conv_endian>:
mov    %edi,%eax
and    $0xffffff,%eax
bswap  %eax
sar    $0x18,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @conv_endian(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 %3, 24
%5 = load i32, i32* %2
%6 = and i32 %5, 65280
%7 = shl i32 %6, 8
%8 = add nsw i32 %4, %7
%9 = load i32, i32* %2
%10 = and i32 %9, 16711680
%11 = ashr i32 %10, 8
%12 = add nsw i32 %8, %11
%13 = load i32, i32* %2
%14 = ashr i32 %13, 24
%15 = add nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @conv_endian(i32 %0) {
%2 = and i32 %0, 16777215
%3 = tail call i32 @llvm.bswap.i32(i32 %2)
%4 = ashr i32 %0, 24
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int n;
  for (n = 0; n <= 255; n++)
    printf("%d-->%c\n", n, n);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d-->%c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %10, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 255
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = load i32, i32* %2
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
br label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 1
store i32 %12, i32* %2
br label %3
13: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d-->%c\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
int foo(int *a) {
  *a += 3;
  return 2;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
add    $0x3,%ecx
mov    %ecx,(%rax)
mov    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
addl   $0x3,(%rdi)
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @foo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = add nsw i32 %4, 3
store i32 %5, i32* %3
ret i32 2
}

LLVM IR (-O2):
define i32 @foo(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = add nsw i32 %2, 3
store i32 %3, i32* %0
ret i32 2
}
adr0adr1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (*((float *)10000000)) = (*((float *)11111111)); }


x86 assembly (clang, -O0):
<adr0adr1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    $0xa98ac7,%eax
movss  (%rax),%xmm0
mov    $0x989680,%eax
movss  %xmm0,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adr0adr1_set>:
movss  0xa98ac7,%xmm0
movss  %xmm0,0x989680
ret

LLVM IR (-O0):
define i32 @adr0adr1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load float, float* inttoptr (i64 11111111 to float*)
store float %16, float* inttoptr (i64 10000000 to float*)
%17 = load i32, i32* %7
ret i32 %17
}

LLVM IR (-O2):
define i32 @adr0adr1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
%7 = load float, float* inttoptr (i64 11111111 to float*)
store float %7, float* inttoptr (i64 10000000 to float*)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void usage(const char *prog_name) { exit(0); }


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @usage(i8* nocapture readnone %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ print_factorial_zero_num(int);
int main(int argc, char *argv[]) {
  uint16_t i;
  for (i = 0; i <= 1000; i += 1) {
    print_factorial_zero_num(i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3e8,-0x14(%rbp)
jg     1150 <main+0x40>
mov    -0x14(%rbp),%edi
call   1030 <print_factorial_zero_num@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <print_factorial_zero_num@plt>
add    $0x1,%ebx
cmp    $0x3e9,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32 [ 0, %2 ], [ %6, %3 ]
%5 = tail call i32 @print_factorial_zero_num(i32 %4)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, 1001
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ inet_addr(char const *);
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t mkkey(const char *addr) { return ntohl(inet_addr(addr)); }


x86 assembly (clang, -O0):
<mkkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %eax,%edi
call   1040 <ntohl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mkkey>:
push   %rax
call   1030 <inet_addr@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <ntohl@plt>

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

LLVM IR (-O2):
define i32 @mkkey(i8* %0) {
%2 = tail call i32 @inet_addr(i8* %0)
%3 = tail call i32 @ntohl(i32 %2)
ret i32 %3
}
float DenseSize(int n, float sum_nw) {
  return (sum_nw * 8 + n * 8) / 1024.;
  ;
}


x86 assembly (clang, -O0):
<DenseSize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
cvtsi2ss %eax,%xmm1
movss  0xee5(%rip),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<DenseSize>:
shl    $0x3,%edi
cvtsi2ss %edi,%xmm1
mulss  0xef1(%rip),%xmm0
addss  %xmm1,%xmm0
mulss  0xee9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @DenseSize(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load float, float* %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 8
%8 = sitofp i32 %7 to float
%9 = call float @llvm.fmuladd.f32(float %5, float 8.000000e+00, float %8)
%10 = fpext float %9 to double
%11 = fdiv double %10, 1.024000e+03
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
define float @DenseSize(i32 %0, float %1) {
%3 = shl nsw i32 %0, 3
%4 = sitofp i32 %3 to float
%5 = tail call float @llvm.fmuladd.f32(float %1, float 8.000000e+00, float %4)
%6 = fmul float %5, 0x3F50000000000000
ret float %6
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int random_uint32();
uint32_t random_uint32_range(uint32_t a, uint32_t b) {
  return (random_uint32() % (b - a)) + a;
}


x86 assembly (clang, -O0):
<random_uint32_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <random_uint32@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_uint32_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <random_uint32@plt>
sub    %ebp,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_uint32_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @random_uint32()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = srem i32 %5, %8
%10 = load i32, i32* %3
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @random_uint32_range(i32 %0, i32 %1) {
%3 = tail call i32 (...) @random_uint32()
%4 = sub nsw i32 %1, %0
%5 = srem i32 %3, %4
%6 = add nsw i32 %5, %0
ret i32 %6
}
int getLSB(unsigned int num) {
  if (num == 0) {
    return -1;
  }
  unsigned int pos = 0;
  while ((num & 1) == 0) {
    ++pos;
    num >>= 1;
  }
  return pos;
}


x86 assembly (clang, -O0):
<getLSB>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <getLSB+0x1d>
movl   $0xffffffff,-0x4(%rbp)
jmp    1150 <getLSB+0x50>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    114a <getLSB+0x4a>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1124 <getLSB+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLSB>:
test   %edi,%edi
je     111e <getLSB+0x1e>
xor    %eax,%eax
test   $0x1,%dil
jne    111d <getLSB+0x1d>
xor    %eax,%eax
mov    %edi,%ecx
add    $0x1,%eax
shr    %ecx
test   $0x2,%dil
mov    %ecx,%edi
je     1110 <getLSB+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @getLSB(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %9, %6 ], [ 0, %3 ]
%8 = phi i32 [ %10, %6 ], [ %0, %3 ]
%9 = add i32 %7, 1
%10 = lshr i32 %8, 1
%11 = and i32 %8, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ -1, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %14
}
int test_imm_FAuint16_mem(unsigned short *val) {
  return ((*val) & (0xFA << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FAuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xfa,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FAuint16_mem>:
testb  $0xfa,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_FAuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 250
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void ble_rsp_attclient_read_multiple(
    const struct ble_msg_attclient_read_multiple_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.ble_msg_attclient_read_multiple_rsp_t = type opaque
define void @ble_rsp_attclient_read_multiple(%struct.ble_msg_attclient_read_multiple_rsp_t* nocapture %0) {
ret void
}
double doubler(int a) { return a * 2.5; }


x86 assembly (clang, -O0):
<doubler>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xeec(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<doubler>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @doubler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sitofp i32 %3 to double
%5 = fmul double %4, 2.500000e+00
ret double %5
}

LLVM IR (-O2):
define double @doubler(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 2.500000e+00
ret double %3
}
/* Variables and functions */
int error(int, char *);
int b_default(int argc, char *argv[]) {
  if (argc > 1)
    return error(1, argv[0]);
  return 0;
}


x86 assembly (clang, -O0):
<b_default>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1142 <b_default+0x32>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x1,%edi
call   1030 <error@plt>
mov    %eax,-0x4(%rbp)
jmp    1149 <b_default+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_default>:
cmp    $0x2,%edi
jl     1122 <b_default+0x12>
mov    (%rsi),%rsi
mov    $0x1,%edi
jmp    1030 <error@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @b_default(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @error(i32 1, i8* %5)
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 0, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ alloc_system_vector(unsigned int);
int /*<<< orphan*/ set_intr_gate(unsigned int, void *);
__attribute__((always_)) void alloc_intr_gate(unsigned int n, void *addr) {
  alloc_system_vector(n);
  set_intr_gate(n, addr);
}


x86 assembly (clang, -O0):
<alloc_intr_gate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <alloc_system_vector@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <set_intr_gate@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_intr_gate>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <alloc_system_vector@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <set_intr_gate@plt>

LLVM IR (-O0):
define void @alloc_intr_gate(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 @alloc_system_vector(i32 %5)
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @set_intr_gate(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @alloc_intr_gate(i32 %0, i8* %1) {
%3 = tail call i32 @alloc_system_vector(i32 %0)
%4 = tail call i32 @set_intr_gate(i32 %0, i8* %1)
ret void
}
/* Type definitions */
struct json_object {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ json_object_new_string(char *);
int /*<<< orphan*/ json_object_object_add(struct json_object *, char *,
                                          int /*<<< orphan*/);
void controller_get_device_info(struct json_object *request,
                                struct json_object *response) {
  json_object_object_add(response, "result",
                         json_object_new_string("controller_get_device_info"));
}


x86 assembly (clang, -O0):
<controller_get_device_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    0xec8(%rip),%rdi
call   1030 <json_object_new_string@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
lea    0xeaf(%rip),%rsi
call   1040 <json_object_object_add@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<controller_get_device_info>:
push   %rbx
mov    %rsi,%rbx
lea    0xedc(%rip),%rdi
call   1030 <json_object_new_string@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
pop    %rbx
jmp    1040 <json_object_object_add@plt>

LLVM IR (-O0):
%struct.json_object = type { i32 }
@.str = [7 x i8] c"result\00"
@.str.1 = [27 x i8] c"controller_get_device_info\00"
define void @controller_get_device_info(%struct.json_object* %0, %struct.json_object* %1) {
%3 = alloca %struct.json_object*
%4 = alloca %struct.json_object*
store %struct.json_object* %0, %struct.json_object** %3
store %struct.json_object* %1, %struct.json_object** %4
%5 = load %struct.json_object*, %struct.json_object** %4
%6 = call i32 @json_object_new_string(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @json_object_object_add(%struct.json_object* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
%struct.json_object = type { i32 }
@.str = [7 x i8] c"result\00"
@.str.1 = [27 x i8] c"controller_get_device_info\00"
define void @controller_get_device_info(%struct.json_object* nocapture readnone %0, %struct.json_object* %1) {
%3 = tail call i32 @json_object_new_string(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @json_object_object_add(%struct.json_object* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ array;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int second_largest_element(int *, int);
int main(void) {
  int array[] = {5, 2, 1, 20, 70, -20, 30, 22, 6, 7, 8, 11, 0, 0};
  int size = sizeof(array) / sizeof(*array);
  printf("Second largest element: %d\n", second_largest_element(array, size));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x38,%edx
call   1040 <memcpy@plt>
movl   $0xe,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1050 <second_largest_element@plt>
mov    %eax,%esi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x30(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xe,%esi
call   1040 <second_largest_element@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@__const.main.array = [14 x i32] [i32 5, i32 2, i32 1, i32 20, i32 70, i32 -20, i32 30, i32 22, i32 6, i32 7, i32 8, i32 11, i32 0, i32 0]
@.str = [28 x i8] c"Second largest element: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [14 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [14 x i32]* %2 to i8*
store i32 14, i32* %3
%5 = getelementptr inbounds [14 x i32], [14 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @second_largest_element(i32* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array = [14 x i32] [i32 5, i32 2, i32 1, i32 20, i32 70, i32 -20, i32 30, i32 22, i32 6, i32 7, i32 8, i32 11, i32 0, i32 0]
@.str = [28 x i8] c"Second largest element: %d\0A\00"
define i32 @main() {
%1 = alloca [14 x i32]
%2 = bitcast [14 x i32]* %1 to i8*
%3 = getelementptr inbounds [14 x i32], [14 x i32]* %1, i64 0, i64 0
%4 = call i32 @second_largest_element(i32* %3, i32 14)
%5 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void t1_TermImager() { return; }


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

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

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

LLVM IR (-O2):
define void @t1_TermImager() {
ret void
}