xunge/DecIR huggingface dataset:
int findComplement(int number) {
  unsigned int i;
  for (i = 1; i <= number; i *= 2) {
    number ^= i;
  }
  return number;
}


x86 assembly (clang, -O0):
<findComplement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
ja     1131 <findComplement+0x31>
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <findComplement+0xe>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<findComplement>:
test   %edi,%edi
je     1119 <findComplement+0x19>
mov    %edi,%eax
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
xor    %ecx,%eax
add    %ecx,%ecx
cmp    %eax,%ecx
jbe    1110 <findComplement+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @findComplement(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp ule i32 %5, %6
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %3
%10 = load i32, i32* %2
%11 = xor i32 %10, %9
store i32 %11, i32* %2
br label %12
12: ; preds = %8
%13 = load i32, i32* %3
%14 = mul i32 %13, 2
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @findComplement(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = xor i32 %4, %5
%7 = shl i32 %4, 1
%8 = icmp ugt i32 %7, %6
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ memset(void *, int /*<<< orphan*/, size_t);
void *pvPortMalloc(size_t);
void *pvPortCalloc(size_t nmemb, size_t size) {
  size_t xWantedSize = nmemb * size;
  void *ptr = pvPortMalloc(xWantedSize);
  if (ptr != NULL)
    memset(ptr, 0, xWantedSize);
  return ptr;
}


x86 assembly (clang, -O0):
<pvPortCalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <pvPortMalloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1164 <pvPortCalloc+0x44>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pvPortCalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
imul   %rsi,%rbx
mov    %rbx,%rdi
call   1040 <pvPortMalloc@plt>
mov    %rax,%r14
test   %rax,%rax
je     1148 <pvPortCalloc+0x28>
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @pvPortCalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul i64 %7, %8
store i64 %9, i64* %5
%10 = load i64, i64* %5
%11 = call i8* @pvPortMalloc(i64 %10)
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = load i64, i64* %5
%17 = call i32 @memset(i8* %15, i32 0, i64 %16)
br label %18
18: ; preds = %14, %2
%19 = load i8*, i8** %6
ret i8* %19
}

LLVM IR (-O2):
define i8* @pvPortCalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @pvPortMalloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @memset(i8* %4, i32 0, i64 %3)
br label %8
8: ; preds = %6, %2
ret i8* %4
}
/* Type definitions */
struct wl_proxy {
  int dummy;
};
struct wl_buffer_listener {
  int dummy;
};
struct wl_buffer {
  int dummy;
};

/* Variables and functions */
int wl_proxy_add_listener(struct wl_proxy *, void (*)(), void *);
int wl_buffer_add_listener(struct wl_buffer *wl_buffer,
                           const struct wl_buffer_listener *listener,
                           void *data) {
  return wl_proxy_add_listener((struct wl_proxy *)wl_buffer,
                               (void (**)(void))listener, data);
}


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

x86 assembly (clang, -O2):
<wl_buffer_add_listener>:
jmp    1030 <wl_proxy_add_listener@plt>

LLVM IR (-O0):
%struct.wl_buffer = type { i32 }
%struct.wl_buffer_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_buffer_add_listener(%struct.wl_buffer* %0, %struct.wl_buffer_listener* %1, i8* %2) {
%4 = alloca %struct.wl_buffer*
%5 = alloca %struct.wl_buffer_listener*
%6 = alloca i8*
store %struct.wl_buffer* %0, %struct.wl_buffer** %4
store %struct.wl_buffer_listener* %1, %struct.wl_buffer_listener** %5
store i8* %2, i8** %6
%7 = load %struct.wl_buffer*, %struct.wl_buffer** %4
%8 = bitcast %struct.wl_buffer* %7 to %struct.wl_proxy*
%9 = load %struct.wl_buffer_listener*, %struct.wl_buffer_listener** %5
%10 = bitcast %struct.wl_buffer_listener* %9 to void ()**
%11 = bitcast void ()** %10 to void (...)*
%12 = load i8*, i8** %6
%13 = call i32 @wl_proxy_add_listener(%struct.wl_proxy* %8, void (...)* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.wl_buffer = type { i32 }
%struct.wl_buffer_listener = type { i32 }
%struct.wl_proxy = type { i32 }
define i32 @wl_buffer_add_listener(%struct.wl_buffer* %0, %struct.wl_buffer_listener* %1, i8* %2) {
%4 = bitcast %struct.wl_buffer* %0 to %struct.wl_proxy*
%5 = bitcast %struct.wl_buffer_listener* %1 to void (...)*
%6 = tail call i32 @wl_proxy_add_listener(%struct.wl_proxy* %4, void (...)* %5, i8* %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_metafont_comments() {
  test_parser_verify_parse(test_parser_sourcefile("metafont", " % comment"),
                           "metafont", "", "% comment", 0);
}


x86 assembly (clang, -O0):
<test_metafont_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xecc(%rip),%rdx
lea    0xebc(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_metafont_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xeda(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xed5(%rip),%rdx
lea    0xec5(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"metafont\00"
@.str.1 = [11 x i8] c" % comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"% comment\00"
define void @test_metafont_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"metafont\00"
@.str.1 = [11 x i8] c" % comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [10 x i8] c"% comment\00"
define void @test_metafont_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ io_con_flush();
void con_flush() { io_con_flush(); }


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

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

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

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

/* Variables and functions */
int _getopt_internal(int, char *const *, char const *, struct option const *,
                     int *, int /*<<< orphan*/);
int timidity_getopt(int argc, char *const *argv, const char *optstring) {
  return _getopt_internal(argc, argv, optstring, (const struct option *)0,
                          (int *)0, 0);
}


x86 assembly (clang, -O0):
<timidity_getopt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %eax,%eax
mov    %eax,%r8d
xor    %r9d,%r9d
mov    %r8,%rcx
call   1030 <_getopt_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timidity_getopt>:
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <_getopt_internal@plt>

LLVM IR (-O0):
%struct.option = type { i32 }
define i32 @timidity_getopt(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = load i8*, i8** %6
%10 = call i32 @_getopt_internal(i32 %7, i8** %8, i8* %9, %struct.option* null, i32* null, i32 0)
ret i32 %10
}

LLVM IR (-O2):
%struct.option = type { i32 }
define i32 @timidity_getopt(i32 %0, i8** %1, i8* %2) {
%4 = tail call i32 @_getopt_internal(i32 %0, i8** %1, i8* %2, %struct.option* null, i32* null, i32 0)
ret i32 %4
}
int fixturedep_fn() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fixturedep_fn() {
ret i32 0
}
void prvCheckTasksWaitingTermination(void) {}


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

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

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

LLVM IR (-O2):
define void @prvCheckTasksWaitingTermination() {
ret void
}
void endl() {
  *((char *)0xffffffff) = '\r';
  *((char *)0xffffffff) = '\n';
}


x86 assembly (clang, -O0):
<endl>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%eax
movb   $0xd,(%rax)
mov    $0xffffffff,%eax
movb   $0xa,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<endl>:
mov    $0xffffffff,%eax
movb   $0xa,(%rax)
ret

LLVM IR (-O0):
define void @endl() {
store i8 13, i8* inttoptr (i64 4294967295 to i8*)
store i8 10, i8* inttoptr (i64 4294967295 to i8*)
ret void
}

LLVM IR (-O2):
define void @endl() {
store i8 10, i8* inttoptr (i64 4294967295 to i8*)
ret void
}
void print_hard_irq_inloop(int ret) {}


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

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

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

LLVM IR (-O2):
define void @print_hard_irq_inloop(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void set_admin_motd() {
  printf("TODO: Allow admin MOTD to be set\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"TODO: Allow admin MOTD to be set\0A\00"
define void @set_admin_motd() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"TODO: Allow admin MOTD to be set\00"
define void @set_admin_motd() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double EvalAngDist_alpha0_2plus_0plus_11520_L2(double);
double funcAngDist_alpha0_2plus_0plus_11520_L2(double *x, double *par) {
  double result;
  result = par[0] * EvalAngDist_alpha0_2plus_0plus_11520_L2(x[0]);
  return result;
}


x86 assembly (clang, -O0):
<funcAngDist_alpha0_2plus_0plus_11520_L2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <EvalAngDist_alpha0_2plus_0plus_11520_L2@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funcAngDist_alpha0_2plus_0plus_11520_L2>:
push   %rax
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  (%rdi),%xmm0
call   1030 <EvalAngDist_alpha0_2plus_0plus_11520_L2@plt>
mulsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @funcAngDist_alpha0_2plus_0plus_11520_L2(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %4
%7 = getelementptr inbounds double, double* %6, i64 0
%8 = load double, double* %7
%9 = load double*, double** %3
%10 = getelementptr inbounds double, double* %9, i64 0
%11 = load double, double* %10
%12 = call double @EvalAngDist_alpha0_2plus_0plus_11520_L2(double %11)
%13 = fmul double %8, %12
store double %13, double* %5
%14 = load double, double* %5
ret double %14
}

LLVM IR (-O2):
define double @funcAngDist_alpha0_2plus_0plus_11520_L2(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %1
%4 = load double, double* %0
%5 = tail call double @EvalAngDist_alpha0_2plus_0plus_11520_L2(double %4)
%6 = fmul double %3, %5
ret double %6
}
__attribute__((no_icf)) _Bool f2(char *s) {
  return s == __builtin_strstr(s, "hello");
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x5,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define zeroext i1 @f2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strstr(i8* %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i8* %3, %5
ret i1 %6
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
define zeroext i1 @f2(i8* nocapture %0) {
%2 = tail call i32 @strncmp(i8* dereferenceable(1) %0, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5)
%3 = icmp eq i32 %2, 0
ret i1 %3
}
void ARGB4444ToYRow_Any_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ARGB4444ToYRow_Any_NEON() {
ret void
}
int main(int argc, const char *argv[]) {
  volatile char *pagezero = (void *)0;
  pagezero[0x1234] = pagezero[0x123];
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
mov    0x123,%al
mov    %al,0x1234
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %6
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i64 291
%9 = load volatile i8, i8* %8
%10 = load i8*, i8** %6
%11 = getelementptr inbounds i8, i8* %10, i64 4660
store volatile i8 %9, i8* %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load volatile i8, i8* inttoptr (i64 291 to i8*)
store volatile i8 %3, i8* inttoptr (i64 4660 to i8*)
ret i32 0
}
char *tostr(int A) {
  if (A != 0)
    return "TRUE";
  return "FALSE";
}


x86 assembly (clang, -O0):
<tostr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1121 <tostr+0x21>
lea    0xee8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    112c <tostr+0x2c>
lea    0xedd(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tostr>:
test   %edi,%edi
lea    0xefc(%rip),%rcx
lea    0xef0(%rip),%rax
cmove  %rcx,%rax
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"TRUE\00"
@.str.1 = [6 x i8] c"FALSE\00"
define i8* @tostr(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0)
ret i8* %3
}
/* Type definitions */
struct rxstate {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ synchunt(struct rxstate *);
void receiver(void *__rx) {
  struct rxstate *rx = (struct rxstate *)__rx;
  synchunt(rx);
}


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

x86 assembly (clang, -O2):
<receiver>:
jmp    1030 <synchunt@plt>

LLVM IR (-O0):
%struct.rxstate = type { i32 }
define void @receiver(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.rxstate*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to %struct.rxstate*
store %struct.rxstate* %5, %struct.rxstate** %3
%6 = load %struct.rxstate*, %struct.rxstate** %3
%7 = call i32 @synchunt(%struct.rxstate* %6)
ret void
}

LLVM IR (-O2):
%struct.rxstate = type { i32 }
define void @receiver(i8* %0) {
%2 = bitcast i8* %0 to %struct.rxstate*
%3 = tail call i32 @synchunt(%struct.rxstate* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void removeFile(char *filename) { unlink(filename); }


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

x86 assembly (clang, -O2):
<removeFile>:
jmp    1030 <unlink@plt>

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

LLVM IR (-O2):
define void @removeFile(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
ret void
}
int sgn(double const x) {
  if (x > 0)
    return 1;
  if (x < 0)
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<sgn>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1127 <sgn+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1148 <sgn+0x48>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1141 <sgn+0x41>
movl   $0xffffffff,-0x4(%rbp)
jmp    1148 <sgn+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sgn>:
xorpd  %xmm1,%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
neg    %ecx
ucomisd %xmm1,%xmm0
mov    $0x1,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @sgn(double %0) {
%2 = alloca i32
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %12
7: ; preds = %1
%8 = load double, double* %3
%9 = fcmp olt double %8, 0.000000e+00
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 -1, i32* %2
br label %12
11: ; preds = %7
store i32 0, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @sgn(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
%3 = fcmp olt double %0, 0.000000e+00
%4 = sext i1 %3 to i32
%5 = select i1 %2, i32 1, i32 %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
__attribute__((noreturn)) void syntax(void) {
  fprintf(stdout, "Usage: msgfmt [OPTION] filename.po ...\n");
  exit(1);
}


x86 assembly (clang, -O0):
<syntax>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<syntax>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [40 x i8] c"Usage: msgfmt [OPTION] filename.po ...\0A\00"
define void @syntax() {
%1 = load i32, i32* @stdout
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [40 x i8] c"Usage: msgfmt [OPTION] filename.po ...\0A\00"
define void @syntax() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ attroff(int /*<<< orphan*/);
void color_pair_off(int color_pair) { attroff(COLOR_PAIR(color_pair)); }


x86 assembly (clang, -O0):
<color_pair_off>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1030 <attroff@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @color_pair_off(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @COLOR_PAIR(i32 %3)
%5 = call i32 @attroff(i32 %4)
ret void
}

LLVM IR (-O2):
define void @color_pair_off(i32 %0) {
%2 = tail call i32 @COLOR_PAIR(i32 %0)
%3 = tail call i32 @attroff(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
char _to_upper(char c) {
  assert((c >= 'a') && (c <= 'z'));
  return (c - 32);
}


x86 assembly (clang, -O0):
<_to_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x61,%ecx
mov    %al,-0x2(%rbp)
jl     113d <_to_upper+0x2d>
movsbl -0x1(%rbp),%eax
cmp    $0x7a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movsbl -0x1(%rbp),%eax
sub    $0x20,%eax
movsbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_to_upper>:
push   %rbx
mov    %edi,%ebx
lea    -0x61(%rbx),%eax
xor    %edi,%edi
cmp    $0x1a,%al
setb   %dil
call   1030 <assert@plt>
add    $0xe0,%bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @_to_upper(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 122
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ false, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8, i8* %2
%15 = sext i8 %14 to i32
%16 = sub nsw i32 %15, 32
%17 = trunc i32 %16 to i8
ret i8 %17
}

LLVM IR (-O2):
define signext i8 @_to_upper(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = add i8 %0, -32
ret i8 %6
}
/* Variables and functions */
float sincalc(unsigned int);
float br(unsigned i) { return 0.5f * (1.0f + sincalc(i)); }


x86 assembly (clang, -O0):
<br>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <sincalc@plt>
movss  0xed9(%rip),%xmm1
addss  %xmm0,%xmm1
movss  0xec9(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<br>:
push   %rax
call   1030 <sincalc@plt>
addss  0xee2(%rip),%xmm0
mulss  0xede(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @br(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call float @sincalc(i32 %3)
%5 = fadd float 1.000000e+00, %4
%6 = fmul float 5.000000e-01, %5
ret float %6
}

LLVM IR (-O2):
define float @br(i32 %0) {
%2 = tail call float @sincalc(i32 %0)
%3 = fadd float %2, 1.000000e+00
%4 = fmul float %3, 5.000000e-01
ret float %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
unsigned hweight64(uint64_t x) {
  uint64_t w = x - ((x >> 1) & 0x5555555555555555ULL);
  w = (w & 0x3333333333333333ULL) + ((w >> 2) & 0x3333333333333333ULL);
  w = (w + (w >> 4)) & 0x0f0f0f0f0f0f0f0fULL;
  return (w * 0x0101010101010101ULL) >> 56;
}


x86 assembly (clang, -O0):
<hweight64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    -0x4(%rbp),%ecx
sar    $0x1,%ecx
movslq %ecx,%rcx
movabs $0x5555555555555555,%rdx
55 55 55
and    %rdx,%rcx
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movabs $0x3333333333333333,%rcx
33 33 33
and    %rcx,%rax
mov    -0x8(%rbp),%ecx
sar    $0x2,%ecx
movslq %ecx,%rcx
movabs $0x3333333333333333,%rdx
33 33 33
and    %rdx,%rcx
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    $0x4,%ecx
add    %ecx,%eax
cltq
movabs $0xf0f0f0f0f0f0f0f,%rcx
0f 0f 0f
and    %rcx,%rax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rax
movabs $0x101010101010101,%rcx
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight64>:
mov    %edi,%eax
shr    %eax
and    $0x55555555,%eax
sub    %eax,%edi
mov    %edi,%eax
and    $0x33333333,%eax
shr    $0x2,%edi
and    $0x33333333,%edi
add    %edi,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
add    %eax,%ecx
and    $0xf0f0f0f,%ecx
movabs $0x101010101010101,%rax
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
ret

LLVM IR (-O0):
define i32 @hweight64(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = load i32, i32* %2
%7 = ashr i32 %6, 1
%8 = sext i32 %7 to i64
%9 = and i64 %8, 6148914691236517205
%10 = sub i64 %5, %9
%11 = trunc i64 %10 to i32
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = and i64 %13, 3689348814741910323
%15 = load i32, i32* %3
%16 = ashr i32 %15, 2
%17 = sext i32 %16 to i64
%18 = and i64 %17, 3689348814741910323
%19 = add i64 %14, %18
%20 = trunc i64 %19 to i32
store i32 %20, i32* %3
%21 = load i32, i32* %3
%22 = load i32, i32* %3
%23 = ashr i32 %22, 4
%24 = add nsw i32 %21, %23
%25 = sext i32 %24 to i64
%26 = and i64 %25, 1085102592571150095
%27 = trunc i64 %26 to i32
store i32 %27, i32* %3
%28 = load i32, i32* %3
%29 = sext i32 %28 to i64
%30 = mul i64 %29, 72340172838076673
%31 = lshr i64 %30, 56
%32 = trunc i64 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @hweight64(i32 %0) {
%2 = lshr i32 %0, 1
%3 = and i32 %2, 1431655765
%4 = sub i32 %0, %3
%5 = and i32 %4, 858993459
%6 = lshr i32 %4, 2
%7 = and i32 %6, 858993459
%8 = add nuw nsw i32 %7, %5
%9 = lshr i32 %8, 4
%10 = add nuw nsw i32 %9, %8
%11 = and i32 %10, 252645135
%12 = zext i32 %11 to i64
%13 = mul i64 %12, 72340172838076673
%14 = lshr i64 %13, 56
%15 = trunc i64 %14 to i32
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  int V1 = 2;
  int V2 = 3;
  int V3 = 1;
  int V4 = V1 == 3 ? V2 : V3;
  printf("%d\n", V4);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x2,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    1142 <main+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1148 <main+0x38>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea8(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, n, m;
  scanf("%d", &a);
  n = a * a;
  m = a * a * a;
  printf("%d\n%d\n", n, m);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edx
mov    %edx,%esi
imul   %edx,%esi
imul   %esi,%edx
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %2
%10 = load i32, i32* %2
%11 = mul nsw i32 %9, %10
%12 = load i32, i32* %2
%13 = mul nsw i32 %11, %12
store i32 %13, i32* %4
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c"%d\0A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = mul nsw i32 %5, %4
%7 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %5, i32 %6)
ret i32 0
}
/* Type definitions */
struct fb_var_screeninfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FBIOGET_VSCREENINFO;
scalar_t__ ioctl(int, int /*<<< orphan*/, struct fb_var_screeninfo *);
int /*<<< orphan*/ perror(char *);
int fb_vscrn_get(int fbfp, struct fb_var_screeninfo *scinfo) {
  if (ioctl(fbfp, FBIOGET_VSCREENINFO, scinfo)) {
    perror("ioctl FBIOGET_VSCREENINFO error\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fb_vscrn_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
je     1166 <fb_vscrn_get+0x46>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <fb_vscrn_get+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_vscrn_get>:
push   %rax
mov    %rsi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    113e <fb_vscrn_get+0x1e>
pop    %rcx
ret
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.fb_var_screeninfo = type { i32 }
@FBIOGET_VSCREENINFO = global i32 0
@.str = [33 x i8] c"ioctl FBIOGET_VSCREENINFO error\0A\00"
define i32 @fb_vscrn_get(i32 %0, %struct.fb_var_screeninfo* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.fb_var_screeninfo*
store i32 %0, i32* %4
store %struct.fb_var_screeninfo* %1, %struct.fb_var_screeninfo** %5
%6 = load i32, i32* %4
%7 = load i32, i32* @FBIOGET_VSCREENINFO
%8 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %5
%9 = call i64 @ioctl(i32 %6, i32 %7, %struct.fb_var_screeninfo* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.fb_var_screeninfo = type { i32 }
@FBIOGET_VSCREENINFO = global i32 0
@.str = [33 x i8] c"ioctl FBIOGET_VSCREENINFO error\0A\00"
define i32 @fb_vscrn_get(i32 %0, %struct.fb_var_screeninfo* %1) {
%3 = load i32, i32* @FBIOGET_VSCREENINFO
%4 = tail call i64 @ioctl(i32 %0, i32 %3, %struct.fb_var_screeninfo* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef int /*<<< orphan*/ uint16_t;
struct rnet_message {
  int dummy;
};

/* Variables and functions */
int add_field(struct rnet_message **, char *, int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ htons(int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
int rnet_message_add_u16(struct rnet_message **msg, char *key, uint16_t val) {
  uint16_t nval = htons(val);
  return add_field(msg, key, strlen(key), (char *)&nval, sizeof(val));
}


x86 assembly (clang, -O0):
<rnet_message_add_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <htons@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
lea    -0x18(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <add_field@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnet_message_add_u16>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %edx,%edi
call   1050 <htons@plt>
mov    %eax,0x4(%rsp)
mov    %rbx,%rdi
call   1040 <strlen@plt>
lea    0x4(%rsp),%rcx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
mov    $0x4,%r8d
call   1030 <add_field@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.rnet_message = type { i32 }
define i32 @rnet_message_add_u16(%struct.rnet_message** %0, i8* %1, i32 %2) {
%4 = alloca %struct.rnet_message**
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store %struct.rnet_message** %0, %struct.rnet_message*** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = call i32 @htons(i32 %8)
store i32 %9, i32* %7
%10 = load %struct.rnet_message**, %struct.rnet_message*** %4
%11 = load i8*, i8** %5
%12 = load i8*, i8** %5
%13 = call i32 @strlen(i8* %12)
%14 = bitcast i32* %7 to i8*
%15 = call i32 @add_field(%struct.rnet_message** %10, i8* %11, i32 %13, i8* %14, i32 4)
ret i32 %15
}

LLVM IR (-O2):
%struct.rnet_message = type { i32 }
define i32 @rnet_message_add_u16(%struct.rnet_message** %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = tail call i32 @htons(i32 %2)
store i32 %6, i32* %4
%7 = tail call i32 @strlen(i8* %1)
%8 = call i32 @add_field(%struct.rnet_message** %0, i8* %1, i32 %7, i8* %5, i32 4)
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void sockDlgUpdate() { usleep(100000); }


x86 assembly (clang, -O0):
<sockDlgUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x186a0,%edi
call   1030 <usleep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sockDlgUpdate>:
mov    $0x186a0,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @sockDlgUpdate() {
%1 = call i32 @usleep(i32 100000)
ret void
}

LLVM IR (-O2):
define void @sockDlgUpdate() {
%1 = tail call i32 @usleep(i32 100000)
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ strlen(char *);
char *json_encapsulate(char *buffer) {
  char *payload = malloc(strlen(buffer) + 2);
  sprintf(payload, "[%s]", buffer);
  return payload;
}


x86 assembly (clang, -O0):
<json_encapsulate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rdi
add    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe9c(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<json_encapsulate>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x2(%rax),%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xeb1(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"[%s]\00"
define i8* @json_encapsulate(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 2
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [5 x i8] c"[%s]\00"
define noalias i8* @json_encapsulate(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 2
%4 = tail call i8* @malloc(i64 %3)
%5 = tail call i32 @sprintf(i8* dereferenceable(1) %4, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((aligned(4096))) hp1(void) { printf("hello, world!\n"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"hello, world!\0A\00"
define void @hp1() align 4096 {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [14 x i8] c"hello, world!\00"
define void @hp1() align 4096 {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
ret void
}
void foo156() {}


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

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

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

LLVM IR (-O2):
define void @foo156() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ put8(int);
void neg_reg64(unsigned int reg64) {
  put8(0x48);
  put8(0xF7);
  put8(0xD8 + reg64);
}


x86 assembly (clang, -O0):
<neg_reg64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0xf7,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
add    $0xd8,%edi
call   1030 <put8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<neg_reg64>:
push   %rbx
mov    %edi,%ebx
mov    $0x48,%edi
call   1030 <put8@plt>
mov    $0xf7,%edi
call   1030 <put8@plt>
add    $0xd8,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1030 <put8@plt>

LLVM IR (-O0):
define void @neg_reg64(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @put8(i32 72)
%4 = call i32 @put8(i32 247)
%5 = load i32, i32* %2
%6 = add i32 216, %5
%7 = call i32 @put8(i32 %6)
ret void
}

LLVM IR (-O2):
define void @neg_reg64(i32 %0) {
%2 = tail call i32 @put8(i32 72)
%3 = tail call i32 @put8(i32 247)
%4 = add i32 %0, 216
%5 = tail call i32 @put8(i32 %4)
ret void
}
int test_imm_70uint16_mem(unsigned short *val) {
  return ((*val) & (-0x70 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_70uint16_mem>:
movzwl (%rdi),%eax
test   $0xff90,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_70uint16_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, -112
%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_70uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -112
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
short no_of_digits(int value) {
  short len = 0;
  int tmp = 1;
  while (tmp < value) {
    len++;
    tmp = (tmp << 3) + (tmp << 1);
  }
  return len;
}


x86 assembly (clang, -O0):
<no_of_digits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movw   $0x0,-0x6(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1142 <no_of_digits+0x42>
mov    -0x6(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x6(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
mov    -0xc(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1114 <no_of_digits+0x14>
movswl -0x6(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_of_digits>:
cmp    $0x2,%edi
jl     111d <no_of_digits+0x1d>
mov    $0x1,%ecx
xor    %eax,%eax
nopl   0x0(%rax)
add    $0x1,%eax
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
cmp    %edi,%ecx
jl     1110 <no_of_digits+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define signext i16 @no_of_digits(i32 %0) {
%2 = icmp sgt i32 %0, 1
br i1 %2, label %3, label %9
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 1, %1 ]
%5 = phi i16 [ %6, %3 ], [ 0, %1 ]
%6 = add i16 %5, 1
%7 = mul i32 %4, 10
%8 = icmp slt i32 %7, %0
br i1 %8, label %3, label %9
9: ; preds = %3, %1
%10 = phi i16 [ 0, %1 ], [ %6, %3 ]
ret i16 %10
}
unsigned int iceil(unsigned int n, unsigned int d) {
  return n / d + ((n % d != 0) ? 1ul : 0ul);
}


x86 assembly (clang, -O0):
<iceil>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    %eax,%eax
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    %edx,%edx
divl   -0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %edx,%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %rdx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iceil>:
mov    %edi,%eax
xor    %edx,%edx
div    %esi
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @iceil(i32 %0, i32 %1) {
%3 = udiv i32 %0, %1
%4 = urem i32 %0, %1
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
%7 = add i32 %3, %6
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct valueset {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void valueset_return_value(struct valueset *vs, uint8_t *ptr) {
  free((void *)ptr);
}


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

x86 assembly (clang, -O2):
<valueset_return_value>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.valueset = type { i32 }
define void @valueset_return_value(%struct.valueset* %0, i32* %1) {
%3 = alloca %struct.valueset*
%4 = alloca i32*
store %struct.valueset* %0, %struct.valueset** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = bitcast i32* %5 to i8*
%7 = call i32 @free(i8* %6)
ret void
}

LLVM IR (-O2):
%struct.valueset = type { i32 }
define void @valueset_return_value(%struct.valueset* nocapture readnone %0, i32* nocapture %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @free(i8* %3)
ret void
}