xunge/DecIR huggingface dataset:
int main(void) {
  int var1;
  int var2;
  int cond1 = 0;
  int cond2 = 1;
  var1 = cond1 ? 0 : 1;
  var2 = cond2 ? 1 : 0;
  var1 = var2 ? 3 : 2;
  return var1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    $0x2,%eax
mov    $0x3,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 1, i32* %5
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 0, i32 1
store i32 %9, i32* %2
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 1, i32 0
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 3, i32 2
store i32 %17, i32* %2
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
void foo108() {}


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

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

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

LLVM IR (-O2):
define void @foo108() {
ret void
}
long labs(x)
long x;
{ return x < 0 ? -x : x; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub nsw i64 0, %6
br label %10
8: ; preds = %1
%9 = load i64, i64* %2
br label %10
10: ; preds = %8, %5
%11 = phi i64 [ %7, %5 ], [ %9, %8 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
char *make_return_packet(int /*<<< orphan*/);
char *gdb_reset() { return (make_return_packet(0)); }


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

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

LLVM IR (-O0):
define i8* @gdb_reset() {
%1 = call i8* @make_return_packet(i32 0)
ret i8* %1
}

LLVM IR (-O2):
define i8* @gdb_reset() {
%1 = tail call i8* @make_return_packet(i32 0)
ret i8* %1
}
void __attribute__((visibility("default"))) mcount_reset(void) {}


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

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

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

LLVM IR (-O2):
define void @mcount_reset() {
ret void
}
/* Variables and functions */
int __parse_common(void *, int *, int *, char *);
int parse_common_pc(void *data) {
  static int pc_offset;
  static int pc_size;
  return __parse_common(data, &pc_size, &pc_offset, "common_preempt_count");
}


x86 assembly (clang, -O0):
<parse_common_pc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0x2f09(%rip),%rsi
lea    0x2efe(%rip),%rdx
lea    0xecb(%rip),%rcx
call   1030 <__parse_common@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_common_pc>:
lea    0x2f19(%rip),%rsi
lea    0x2f0e(%rip),%rdx
lea    0xedb(%rip),%rcx
jmp    1030 <__parse_common@plt>

LLVM IR (-O0):
@parse_common_pc.pc_offset = internal global i32 0
@parse_common_pc.pc_size = internal global i32 0
@.str = [21 x i8] c"common_preempt_count\00"
define i32 @parse_common_pc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @__parse_common(i8* %3, i32* @parse_common_pc.pc_size, i32* @parse_common_pc.pc_offset, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}

LLVM IR (-O2):
@parse_common_pc.pc_offset = internal global i32 0
@parse_common_pc.pc_size = internal global i32 0
@.str = [21 x i8] c"common_preempt_count\00"
define i32 @parse_common_pc(i8* %0) {
%2 = tail call i32 @__parse_common(i8* %0, i32* @parse_common_pc.pc_size, i32* @parse_common_pc.pc_offset, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 %2
}
/* Variables and functions */
int core3_safe(char const *);
int U_EMRSETARCDIRECTION_safe(const char *record) {
  return (core3_safe(record));
}


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

x86 assembly (clang, -O2):
<U_EMRSETARCDIRECTION_safe>:
jmp    1030 <core3_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRSETARCDIRECTION_safe(i8* %0) {
%2 = tail call i32 @core3_safe(i8* %0)
ret i32 %2
}
/* Type definitions */
struct servent {
  int dummy;
};
typedef enum nss_status { ____Placeholder_nss_status } nss_status;

/* Variables and functions */
int internal_getservent_r(struct servent *, char *, size_t, int *);
int /*<<< orphan*/ sss_nss_lock();
int /*<<< orphan*/ sss_nss_unlock();
enum nss_status _nss_sss_getservent_r(struct servent *result, char *buffer,
                                      size_t buflen, int *errnop) {
  enum nss_status nret;
  sss_nss_lock();
  nret = internal_getservent_r(result, buffer, buflen, errnop);
  sss_nss_unlock();
  return nret;
}


x86 assembly (clang, -O0):
<_nss_sss_getservent_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1030 <sss_nss_lock@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1040 <internal_getservent_r@plt>
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   1050 <sss_nss_unlock@plt>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nss_sss_getservent_r>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <sss_nss_lock@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %r14,%rcx
call   1040 <internal_getservent_r@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1050 <sss_nss_unlock@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.servent = type { i32 }
define i32 @_nss_sss_getservent_r(%struct.servent* %0, i8* %1, i64 %2, i32* %3) {
%5 = alloca %struct.servent*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32
store %struct.servent* %0, %struct.servent** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = call i32 (...) @sss_nss_lock()
%11 = load %struct.servent*, %struct.servent** %5
%12 = load i8*, i8** %6
%13 = load i64, i64* %7
%14 = load i32*, i32** %8
%15 = call i32 @internal_getservent_r(%struct.servent* %11, i8* %12, i64 %13, i32* %14)
store i32 %15, i32* %9
%16 = call i32 (...) @sss_nss_unlock()
%17 = load i32, i32* %9
ret i32 %17
}

LLVM IR (-O2):
%struct.servent = type { i32 }
define i32 @_nss_sss_getservent_r(%struct.servent* %0, i8* %1, i64 %2, i32* %3) {
%5 = tail call i32 (...) @sss_nss_lock()
%6 = tail call i32 @internal_getservent_r(%struct.servent* %0, i8* %1, i64 %2, i32* %3)
%7 = tail call i32 (...) @sss_nss_unlock()
ret i32 %6
}
char *strlib_uncomment(char *s) {
  char *ps;
  if (!s)
    return ("");
  ps = s;
  while (*ps) {
    if (*ps == '#')
      break;
    ps++;
  }
  *ps = '\0';
  return (s);
}


x86 assembly (clang, -O0):
<strlib_uncomment>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1123 <strlib_uncomment+0x23>
lea    0xee6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116d <strlib_uncomment+0x6d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     115e <strlib_uncomment+0x5e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    114d <strlib_uncomment+0x4d>
jmp    115e <strlib_uncomment+0x5e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112b <strlib_uncomment+0x2b>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlib_uncomment>:
test   %rdi,%rdi
je     1126 <strlib_uncomment+0x26>
mov    %rdi,%rax
mov    %rdi,%rcx
nopl   0x0(%rax,%rax,1)
movzbl (%rcx),%edx
test   %dl,%dl
je     1122 <strlib_uncomment+0x22>
cmp    $0x23,%dl
je     1122 <strlib_uncomment+0x22>
add    $0x1,%rcx
jmp    1110 <strlib_uncomment+0x10>
movb   $0x0,(%rcx)
ret
lea    0xed3(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @strlib_uncomment(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %2
br label %26
8: ; preds = %1
%9 = load i8*, i8** %3
store i8* %9, i8** %4
br label %10
10: ; preds = %20, %8
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %23
14: ; preds = %10
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 35
br i1 %18, label %19, label %20
19: ; preds = %14
br label %23
20: ; preds = %14
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %4
br label %10
23: ; preds = %19, %10
%24 = load i8*, i8** %4
store i8 0, i8* %24
%25 = load i8*, i8** %3
store i8* %25, i8** %2
br label %26
26: ; preds = %23, %7
%27 = load i8*, i8** %2
ret i8* %27
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @strlib_uncomment(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %6
%4 = phi i8* [ %7, %6 ], [ %0, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 35, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
br label %3
8: ; preds = %3, %3
store i8 0, i8* %4
br label %9
9: ; preds = %1, %8
%10 = phi i8* [ %0, %8 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
scalar_t__ kill(int /*<<< orphan*/ const, int /*<<< orphan*/);
int resctrl_alloc_task_validate(const pid_t task) {
  if (kill(task, 0) == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<resctrl_alloc_task_validate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
xor    %esi,%esi
call   1030 <kill@plt>
cmp    $0x0,%rax
jne    113b <resctrl_alloc_task_validate+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1142 <resctrl_alloc_task_validate+0x32>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resctrl_alloc_task_validate>:
push   %rax
xor    %esi,%esi
call   1030 <kill@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @resctrl_alloc_task_validate(i32 %0) {
%2 = tail call i64 @kill(i32 %0, i32 0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void nested_compound_literals(int rad) {
  int vec[6][2] = {{0.195, 0.02}, {0.383, 0.067}, {0.55, 0.169},
                   {0.831, 0.45}, {0.924, 0.617}, {0.98, 0.805}};
  int a;
  for (a = 0; a < 6; ++a) {
    vec[a][0] *= rad;
    vec[a][1] *= rad;
  }
}


x86 assembly (clang, -O0):
<nested_compound_literals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x6,-0x44(%rbp)
jge    116a <nested_compound_literals+0x5a>
mov    -0x4(%rbp),%ecx
movslq -0x44(%rbp),%rax
imul   -0x40(%rbp,%rax,8),%ecx
mov    %ecx,-0x40(%rbp,%rax,8)
mov    -0x4(%rbp),%ecx
movslq -0x44(%rbp),%rax
imul   -0x3c(%rbp,%rax,8),%ecx
mov    %ecx,-0x3c(%rbp,%rax,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1132 <nested_compound_literals+0x22>
add    $0x50,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @nested_compound_literals(i32 %0) {
%2 = alloca i32
%3 = alloca [6 x [2 x i32]]
%4 = alloca i32
store i32 %0, i32* %2
%5 = bitcast [6 x [2 x i32]]* %3 to i8*
store i32 0, i32* %4
br label %6
6: ; preds = %24, %1
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 6
br i1 %8, label %9, label %27
9: ; preds = %6
%10 = load i32, i32* %2
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %3, i64 0, i64 %12
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 0, i64 0
%15 = load i32, i32* %14
%16 = mul nsw i32 %15, %10
store i32 %16, i32* %14
%17 = load i32, i32* %2
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %3, i64 0, i64 %19
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %20, i64 0, i64 1
%22 = load i32, i32* %21
%23 = mul nsw i32 %22, %17
store i32 %23, i32* %21
br label %24
24: ; preds = %9
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %6
27: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @nested_compound_literals(i32 %0) {
ret void
}
int mx31_gpio_get(unsigned int gpio) { return 1; }


x86 assembly (clang, -O0):
<mx31_gpio_get>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @mx31_gpio_get(i32 %0) {
ret i32 1
}
int xfuse_file_contents_range(int stream_id, char *data, int data_bytes) {
  return 0;
}


x86 assembly (clang, -O0):
<xfuse_file_contents_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xfuse_file_contents_range(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @xfuse_file_contents_range(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isPosixLocale(const char *locale) {
  if (strcmp(locale, "C") == 0)
    return 1;
  if (strcmp(locale, "POSIX") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isPosixLocale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <isPosixLocale+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <isPosixLocale+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <isPosixLocale+0x58>
movl   $0x1,-0x4(%rbp)
jmp    116f <isPosixLocale+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPosixLocale>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <isPosixLocale+0x31>
lea    0xed6(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"C\00"
@.str.1 = [6 x i8] c"POSIX\00"
define i32 @isPosixLocale(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
float fxt1_quantize_ALPHA1() {
  int j1;
  int i;
  float *tv;
  for (j1 = 1; j1; j1++) {
    float e;
    for (i = 1; i; i++)
      e = tv[i];
    if (e)
      i = j1;
  }
  return tv[i];
}


x86 assembly (clang, -O0):
<fxt1_quantize_ALPHA1>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     117b <fxt1_quantize_ALPHA1+0x7b>
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1146 <fxt1_quantize_ALPHA1+0x46>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <fxt1_quantize_ALPHA1+0x1c>
movss  -0x14(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    1162 <fxt1_quantize_ALPHA1+0x62>
jp     1162 <fxt1_quantize_ALPHA1+0x62>
jmp    1168 <fxt1_quantize_ALPHA1+0x68>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    116d <fxt1_quantize_ALPHA1+0x6d>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <fxt1_quantize_ALPHA1+0xb>
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define float @fxt1_quantize_ALPHA1() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float*
%4 = alloca float
store i32 1, i32* %1
br label %5
5: ; preds = %27, %0
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %30
8: ; preds = %5
store i32 1, i32* %2
br label %9
9: ; preds = %18, %8
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load float*, float** %3
%14 = load i32, i32* %2
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %13, i64 %15
%17 = load float, float* %16
store float %17, float* %4
br label %18
18: ; preds = %12
%19 = load i32, i32* %2
%20 = add nsw i32 %19, 1
store i32 %20, i32* %2
br label %9
21: ; preds = %9
%22 = load float, float* %4
%23 = fcmp une float %22, 0.000000e+00
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = load i32, i32* %1
store i32 %25, i32* %2
br label %26
26: ; preds = %24, %21
br label %27
27: ; preds = %26
%28 = load i32, i32* %1
%29 = add nsw i32 %28, 1
store i32 %29, i32* %1
br label %5
30: ; preds = %5
%31 = load float*, float** %3
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds float, float* %31, i64 %33
%35 = load float, float* %34
ret float %35
}

LLVM IR (-O2):
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void put_uint32le(uint32_t x, unsigned char *p) {
  p[0] = x & 0xff;
  p[1] = (x >> 8) & 0xff;
  p[2] = (x >> 16) & 0xff;
  p[3] = (x >> 24) & 0xff;
}


x86 assembly (clang, -O0):
<put_uint32le>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_uint32le>:
mov    %edi,(%rsi)
ret

LLVM IR (-O0):
define void @put_uint32le(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 = and i32 %5, 255
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i64 0
store i8 %7, i8* %9
%10 = load i32, i32* %3
%11 = ashr i32 %10, 8
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
%16 = load i32, i32* %3
%17 = ashr i32 %16, 16
%18 = and i32 %17, 255
%19 = trunc i32 %18 to i8
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i64 2
store i8 %19, i8* %21
%22 = load i32, i32* %3
%23 = ashr i32 %22, 24
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %4
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @put_uint32le(i32 %0, i8* nocapture writeonly %1) {
%3 = trunc i32 %0 to i8
store i8 %3, i8* %1
%4 = lshr i32 %0, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %0, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %8, i8* %9
%10 = lshr i32 %0, 24
%11 = trunc i32 %10 to i8
%12 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %11, i8* %12
ret void
}
const char *bin_postfix() { return ""; }


x86 assembly (clang, -O0):
<bin_postfix>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bin_postfix>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @bin_postfix() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @bin_postfix() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ link_error();
int f(double a, double b) {
  if (((a * a) + (b * b)) < 0)
    link_error();
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
ucomisd %xmm1,%xmm0
jbe    1152 <f+0x42>
mov    $0x0,%al
call   1030 <link_error@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @f(double %0, double %1) {
%3 = alloca i32
%4 = alloca double
%5 = alloca double
store double %0, double* %4
store double %1, double* %5
%6 = load double, double* %4
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %5
%10 = fmul double %8, %9
%11 = call double @llvm.fmuladd.f64(double %6, double %7, double %10)
%12 = fcmp olt double %11, 0.000000e+00
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = call i32 (...) @link_error()
br label %15
15: ; preds = %13, %2
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @f(double %0, double %1) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void ICPrintMamaPapa(int mama, int papa) {
  char *parentsValue = mama > papa ? "Mama" : "Papa";
  printf("%s\n", parentsValue);
}


x86 assembly (clang, -O0):
<ICPrintMamaPapa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
lea    0xeda(%rip),%rax
lea    0xece(%rip),%rcx
cmp    %esi,%edx
cmovg  %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ICPrintMamaPapa>:
cmp    %esi,%edi
lea    0xee7(%rip),%rax
lea    0xee5(%rip),%rsi
cmovg  %rax,%rsi
lea    0xedf(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"Mama\00"
@.str.1 = [5 x i8] c"Papa\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @ICPrintMamaPapa(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp sgt i32 %6, %7
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"Mama\00"
@.str.1 = [5 x i8] c"Papa\00"
@.str.2 = [4 x i8] c"%s\0A\00"
define void @ICPrintMamaPapa(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* %4)
ret void
}
int bcmdhd_init_wlan_mem(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @bcmdhd_init_wlan_mem() {
ret i32 0
}
/* Variables and functions */
int incr(int);
int main(void) {
  int a = 1;
  int b = incr(a);
  return b;
}


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

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
jmp    1030 <incr@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @incr(i32 1)
ret i32 %1
}
/* Variables and functions */
int get_mod_time(char *, char *);
scalar_t__ strcmp(char *, char *);
int modified(char fname[], char run_time[]) {
  char mod_time[20];
  int r;
  r = get_mod_time(mod_time, fname);
  if (r < 0)
    return -1;
  else if (strcmp(mod_time, run_time) > 0)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<modified>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <get_mod_time@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jge    1156 <modified+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <modified+0x60>
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jle    1179 <modified+0x59>
movl   $0x1,-0x4(%rbp)
jmp    1180 <modified+0x60>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<modified>:
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%rdi
call   1030 <get_mod_time@plt>
test   %eax,%eax
js     114f <modified+0x2f>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1040 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setg   %al
jmp    1154 <modified+0x34>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @modified(i8* %0, i8* %1) {
%3 = alloca [20 x i8]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%5 = call i32 @get_mod_time(i8* %4, i8* %0)
%6 = icmp slt i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = call i64 @strcmp(i8* %4, i8* %1)
%9 = icmp sgt i64 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %2
%12 = phi i32 [ -1, %2 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int /*<<< orphan*/ end_message(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void check_ptr_or_quit(void *ptr) {
  if (ptr == NULL) {
    printf("{\"ok\": false, \"error\": \"Out of memory! Quitting\"}");
    end_message(stdout);
    assert(ptr);
  }
  return;
}


x86 assembly (clang, -O0):
<check_ptr_or_quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    116a <check_ptr_or_quit+0x3a>
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1030 <end_message@plt>
mov    -0x8(%rbp),%rdi
call   1050 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_ptr_or_quit>:
test   %rdi,%rdi
je     1136 <check_ptr_or_quit+0x6>
ret
push   %rax
lea    0xec2(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1030 <end_message@plt>
xor    %edi,%edi
pop    %rax
jmp    1050 <assert@plt>

LLVM IR (-O0):
@.str = [50 x i8] c"{\22ok\22: false, \22error\22: \22Out of memory! Quitting\22}\00"
@stdout = global i32 0
define void @check_ptr_or_quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @stdout
%8 = call i32 @end_message(i32 %7)
%9 = load i8*, i8** %2
%10 = call i32 @assert(i8* %9)
br label %11
11: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
@.str = [50 x i8] c"{\22ok\22: false, \22error\22: \22Out of memory! Quitting\22}\00"
@stdout = global i32 0
define void @check_ptr_or_quit(i8* readnone %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = tail call i32 @end_message(i32 %5)
%7 = tail call i32 @assert(i8* null)
br label %8
8: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ EVP_CIPHER_CTX;

/* Variables and functions */
int /*<<< orphan*/ *EVP_CIPHER_CTX_new();
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/ *);
void EVP_CIPHER_CTX_new_test() {
  EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
  printf("%p", ctx);
}


x86 assembly (clang, -O0):
<EVP_CIPHER_CTX_new_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <EVP_CIPHER_CTX_new@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EVP_CIPHER_CTX_new_test>:
push   %rax
xor    %eax,%eax
call   1040 <EVP_CIPHER_CTX_new@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%p\00"
define void @EVP_CIPHER_CTX_new_test() {
%1 = alloca i32*
%2 = call i32* (...) @EVP_CIPHER_CTX_new()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%p\00"
define void @EVP_CIPHER_CTX_new_test() {
%1 = tail call i32* (...) @EVP_CIPHER_CTX_new()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
ret void
}
void writestr(sp, s) struct slot *sp;
char *s;
{
  while (*s)
    writech(sp, *s++);
}


x86 assembly (clang, -O0):
<writestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114f <writestr+0x3f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%esi
mov    $0x0,%al
call   1030 <writech@plt>
jmp    1120 <writestr+0x10>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writestr>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     1148 <writestr+0x38>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <writech@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <writestr+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
%struct.slot = type opaque
define void @writestr(%struct.slot* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %1, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 (%struct.slot*, i32, ...) bitcast (i32 (...)* @writech to i32 (%struct.slot*, i32, ...)*)(%struct.slot* %0, i32 %9)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ perror(char *);
void *emalloc(size_t size) {
  void *np = malloc(size);
  if (np == NULL)
    perror("malloc");
  return np;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <emalloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <perror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1133 <emalloc+0x13>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xec6(%rip),%rdi
call   1040 <perror@plt>
jmp    112e <emalloc+0xe>

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 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 = [7 x i8] c"malloc\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void mailimf_field_name_free(char *field_name) { free(field_name); }


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

x86 assembly (clang, -O2):
<mailimf_field_name_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @mailimf_field_name_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int add(int a, int b) {
  int res = a;
  __asm__("addl %[var],%0" : "+r"(res) : [var] "r"(b));
  return res;
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
mov    %edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @add(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = call i32 asm "addl $1,$0", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i32 %8, i32 %7)
store i32 %9, i32* %5
%10 = load i32, i32* %5
ret i32 %10
}

LLVM IR (-O2):
define i32 @add(i32 %0, i32 %1) {
%3 = tail call i32 asm "addl $1,$0", "=r,r,0,~{dirflag},~{fpsr},~{flags}"(i32 %1, i32 %0)
ret i32 %3
}
void swap(char *v1, char *v2) {
  char temp = *v1;
  *v1 = *v2;
  *v2 = temp;
}


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

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

LLVM IR (-O0):
define void @swap(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
store i8 %7, i8* %5
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = load i8*, i8** %3
store i8 %9, i8* %10
%11 = load i8, i8* %5
%12 = load i8*, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @swap(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
store i8 %4, i8* %0
store i8 %3, i8* %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ XErrorEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int Handler(Display *display, XErrorEvent *event) { return (0); }


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

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

LLVM IR (-O0):
define i32 @Handler(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @Handler(i32* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int cos(double);
double SineEaseInOut(double p) {
  return 0.5 * (1 - cos(p * 3.14159265358979323846264338327));
}


x86 assembly (clang, -O0):
<SineEaseInOut>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xee3(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <cos@plt>
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm1
movsd  0xebc(%rip),%xmm0
mulsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SineEaseInOut>:
push   %rax
mulsd  0xee7(%rip),%xmm0
call   1030 <cos@plt>
mov    $0x1,%ecx
sub    %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
mulsd  0xed4(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @SineEaseInOut(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double %3, 0x400921FB54442D18
%5 = call i32 @cos(double %4)
%6 = sub nsw i32 1, %5
%7 = sitofp i32 %6 to double
%8 = fmul double 5.000000e-01, %7
ret double %8
}

LLVM IR (-O2):
define double @SineEaseInOut(double %0) {
%2 = fmul double %0, 0x400921FB54442D18
%3 = tail call i32 @cos(double %2)
%4 = sub nsw i32 1, %3
%5 = sitofp i32 %4 to double
%6 = fmul double %5, 5.000000e-01
ret double %6
}
/* Variables and functions */
scalar_t__ remove(char *);
int /*<<< orphan*/ warnx(char *, char *);
void dinfo_free_devnode(char *device) {
  if (remove(device))
    warnx("Warning: Could not remove temporary file %s", device);
}


x86 assembly (clang, -O0):
<dinfo_free_devnode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
je     114f <dinfo_free_devnode+0x2f>
mov    -0x8(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <warnx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dinfo_free_devnode>:
push   %rbx
mov    %rdi,%rbx
call   1030 <remove@plt>
test   %rax,%rax
je     113e <dinfo_free_devnode+0x1e>
lea    0xecb(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <warnx@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Warning: Could not remove temporary file %s\00"
define void @dinfo_free_devnode(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @remove(i8* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @warnx(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %7)
br label %9
9: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"Warning: Could not remove temporary file %s\00"
define void @dinfo_free_devnode(i8* %0) {
%2 = tail call i64 @remove(i8* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @warnx(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ reverse_char_array(char *, int);
int main(void) {
  char *string = (char *)malloc(4 * sizeof(char));
  string[0] = 'c';
  string[1] = 'a';
  string[2] = 't';
  string[3] = '\0';
  reverse_char_array(string, 3);
  puts(string);
  free(string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x63,(%rax)
mov    -0x10(%rbp),%rax
movb   $0x61,0x1(%rax)
mov    -0x10(%rbp),%rax
movb   $0x74,0x2(%rax)
mov    -0x10(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1060 <reverse_char_array@plt>
mov    -0x10(%rbp),%rdi
call   1040 <puts@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x4,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movl   $0x746163,(%rax)
mov    %rax,%rdi
mov    $0x3,%esi
call   1060 <reverse_char_array@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i8*
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 0
store i8 99, i8* %6
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 1
store i8 97, i8* %8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 2
store i8 116, i8* %10
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 3
store i8 0, i8* %12
%13 = load i8*, i8** %2
%14 = call i32 @reverse_char_array(i8* %13, i32 3)
%15 = load i8*, i8** %2
%16 = call i32 @puts(i8* %15)
%17 = load i8*, i8** %2
%18 = call i32 @free(i8* %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i8*
store i8 99, i8* %2
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8 97, i8* %3
%4 = getelementptr inbounds i8, i8* %2, i64 2
store i8 116, i8* %4
%5 = getelementptr inbounds i8, i8* %2, i64 3
store i8 0, i8* %5
%6 = tail call i32 @reverse_char_array(i8* %2, i32 3)
%7 = tail call i32 @puts(i8* %2)
%8 = tail call i32 @free(i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int usage() {
  printf("./rpi-toolbox util read|write [port] [0|1]");
  return -1;
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"./rpi-toolbox util read|write [port] [0|1]\00"
define i32 @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@.str = [43 x i8] c"./rpi-toolbox util read|write [port] [0|1]\00"
define i32 @usage() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t rdram_reg(uint32_t address) { return (address & 0x3ff) >> 2; }


x86 assembly (clang, -O0):
<rdram_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3ff,%eax
sar    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdram_reg>:
shr    $0x2,%edi
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @rdram_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1023
%5 = ashr i32 %4, 2
ret i32 %5
}

LLVM IR (-O2):
define i32 @rdram_reg(i32 %0) {
%2 = lshr i32 %0, 2
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XGetIconSizes() {
  printf("XGetIconSizes called\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<XGetIconSizes>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"XGetIconSizes called\0A\00"
define i32 @XGetIconSizes() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"XGetIconSizes called\00"
define i32 @XGetIconSizes() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret i32 0
}