xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(unsigned long, unsigned char, int);
int /*<<< orphan*/ GPIOPadConfigSet(unsigned long, unsigned char, int, int);
void GPIOPinTypeFan(unsigned long ulPort, unsigned char ucPins) {
  ;
  GPIODirModeSet(ulPort, ucPins, 0x00000002);
  GPIOPadConfigSet(ulPort, ucPins, 0x00000001, 0x00000008);
}


x86 assembly (clang, -O0):
<GPIOPinTypeFan>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%edx
movzbl -0x9(%rbp),%esi
call   1040 <GPIODirModeSet@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    $0x8,%ecx
movzbl -0x9(%rbp),%esi
call   1030 <GPIOPadConfigSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeFan>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x2,%edx
call   1040 <GPIODirModeSet@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x8,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <GPIOPadConfigSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeFan(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = load i8, i8* %4
%7 = call i32 @GPIODirModeSet(i64 %5, i8 zeroext %6, i32 2)
%8 = load i64, i64* %3
%9 = load i8, i8* %4
%10 = call i32 @GPIOPadConfigSet(i64 %8, i8 zeroext %9, i32 1, i32 8)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeFan(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIODirModeSet(i64 %0, i8 zeroext %1, i32 2)
%4 = tail call i32 @GPIOPadConfigSet(i64 %0, i8 zeroext %1, i32 1, i32 8)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ init_reg();
int /*<<< orphan*/ init_state();
void destructive_reset(void) {
  init_reg();
  init_state();
}


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

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

LLVM IR (-O0):
define void @destructive_reset() {
%1 = call i32 (...) @init_reg()
%2 = call i32 (...) @init_state()
ret void
}

LLVM IR (-O2):
define void @destructive_reset() {
%1 = tail call i32 (...) @init_reg()
%2 = tail call i32 (...) @init_state()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_n_times(int);
void do_2_times_constant() { do_n_times(2); }


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

x86 assembly (clang, -O2):
<do_2_times_constant>:
mov    $0x2,%edi
jmp    1030 <do_n_times@plt>

LLVM IR (-O0):
define void @do_2_times_constant() {
%1 = call i32 @do_n_times(i32 2)
ret void
}

LLVM IR (-O2):
define void @do_2_times_constant() {
%1 = tail call i32 @do_n_times(i32 2)
ret void
}
__attribute__((always_)) void
validate_creds_for_do_exit(struct task_struct *tsk) {}


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define void @validate_creds_for_do_exit(%struct.task_struct* nocapture %0) {
ret void
}
int main() {
  int a;
  int b;
  int c;
  c = a + b + 5;
  return c;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    $0x5,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 undef
}
int Operand_bt8_decode(unsigned int *valp) {
  *valp = *valp << 3;
  return 0;
}


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

x86 assembly (clang, -O2):
<Operand_bt8_decode>:
shll   $0x3,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Operand_bt8_decode(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 3
store i32 %3, i32* %0
ret i32 0
}
void termop_restcurattr(struct ansiseq *s) {
  tnc_log_log(
      6, 4, -1,
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c",
      335, __func__, "unhandled");
  ansiseq_dump(s);
}


x86 assembly (clang, -O0):
<termop_restcurattr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
lea    0xebe(%rip),%rcx
mov    $0x14f,%r8d
lea    0xf37(%rip),%r9
lea    0xf43(%rip),%rax
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <tnc_log_log@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <ansiseq_dump@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<termop_restcurattr>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf6a(%rip),%rax
mov    %rax,(%rsp)
lea    0xec6(%rip),%rcx
lea    0xf45(%rip),%r9
mov    $0x6,%edi
mov    $0x4,%esi
mov    $0xffffffff,%edx
mov    $0x14f,%r8d
xor    %eax,%eax
call   1030 <tnc_log_log@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <ansiseq_dump@plt>

LLVM IR (-O0):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_restcurattr = [19 x i8] c"termop_restcurattr\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_restcurattr(%struct.ansiseq* %0) {
%2 = alloca %struct.ansiseq*
store %struct.ansiseq* %0, %struct.ansiseq** %2
%3 = call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.termop_restcurattr, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load %struct.ansiseq*, %struct.ansiseq** %2
%5 = call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %4)
ret void
}

LLVM IR (-O2):
%struct.ansiseq = type opaque
@.str = [134 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fstd/telnetcat/refs/heads/devel/src/vt100.c\00"
@__func__.termop_restcurattr = [19 x i8] c"termop_restcurattr\00"
@.str.1 = [10 x i8] c"unhandled\00"
define void @termop_restcurattr(%struct.ansiseq* %0) {
%2 = tail call i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @tnc_log_log to i32 (i32, i32, i32, i8*, i32, i8*, i8*, ...)*)(i32 6, i32 4, i32 -1, i8* getelementptr inbounds ([134 x i8], [134 x i8]* @.str, i64 0, i64 0), i32 335, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.termop_restcurattr, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (%struct.ansiseq*, ...) bitcast (i32 (...)* @ansiseq_dump to i32 (%struct.ansiseq*, ...)*)(%struct.ansiseq* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ OSSwapConstInt16(int /*<<< orphan*/);
uint16_t _OSSwapInt16(uint16_t data) { return OSSwapConstInt16(data); }


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

x86 assembly (clang, -O2):
<_OSSwapInt16>:
jmp    1030 <OSSwapConstInt16@plt>

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

LLVM IR (-O2):
define i32 @_OSSwapInt16(i32 %0) {
%2 = tail call i32 @OSSwapConstInt16(i32 %0)
ret i32 %2
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 && (*s1 == *s2)) {
    s1++, s2++;
  }
  return *(const unsigned char *)s1 - *(const unsigned char *)s2;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1137 <strcmp+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1147 <strcmp+0x47>
jmp    1164 <strcmp+0x64>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <strcmp+0xc>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    (%rdi),%al
test   %al,%al
je     1123 <strcmp+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
cmp    (%rsi),%al
jne    1125 <strcmp+0x25>
add    $0x1,%rsi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <strcmp+0x10>
xor    %eax,%eax
movzbl %al,%eax
movzbl (%rsi),%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %11
%6 = phi i8 [ %14, %11 ], [ %3, %2 ]
%7 = phi i8* [ %13, %11 ], [ %1, %2 ]
%8 = phi i8* [ %12, %11 ], [ %0, %2 ]
%9 = load i8, i8* %7
%10 = icmp eq i8 %6, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = load i8, i8* %12
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %11, %2
%17 = phi i8* [ %1, %2 ], [ %13, %11 ], [ %7, %5 ]
%18 = phi i8 [ 0, %2 ], [ 0, %11 ], [ %6, %5 ]
%19 = zext i8 %18 to i32
%20 = load i8, i8* %17
%21 = zext i8 %20 to i32
%22 = sub nsw i32 %19, %21
ret i32 %22
}
void U_EMRREALIZEPALETTE_print(const char *contents) { (void)contents; }


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

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

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

LLVM IR (-O2):
define void @U_EMRREALIZEPALETTE_print(i8* nocapture %0) {
ret void
}
void __attribute__((weak)) foo() {}


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

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

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

LLVM IR (-O2):
define weak void @foo() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int standard_Newton_Laurent_step(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(326, a, b, c);
  return fail;
}


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

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

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

LLVM IR (-O2):
define i32 @standard_Newton_Laurent_step() {
%1 = tail call i32 @_ada_use_c2phc(i32 326, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
char *ft_memcpy(char *, char const *, scalar_t__);
scalar_t__ ft_strlen(char const *);
char *ft_strcpy(char *s1, const char *s2) {
  return (ft_memcpy(s1, s2, ft_strlen(s2) + 1));
}


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

x86 assembly (clang, -O2):
<ft_strcpy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <ft_strlen@plt>
lea    0x1(%rax),%rdx
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ft_memcpy@plt>

LLVM IR (-O0):
define i8* @ft_strcpy(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @ft_strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i8* @ft_memcpy(i8* %5, i8* %6, i64 %9)
ret i8* %10
}

LLVM IR (-O2):
define i8* @ft_strcpy(i8* %0, i8* %1) {
%3 = tail call i64 @ft_strlen(i8* %1)
%4 = add nsw i64 %3, 1
%5 = tail call i8* @ft_memcpy(i8* %0, i8* %1, i64 %4)
ret i8* %5
}
/* Variables and functions */
int read_hexstr(unsigned char *, int, char *);
int mpk_pkginfo_signature_deserialize(unsigned char signature[], char *src) {
  return read_hexstr(signature, 256, src);
}


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

x86 assembly (clang, -O2):
<mpk_pkginfo_signature_deserialize>:
mov    %rsi,%rdx
mov    $0x100,%esi
jmp    1030 <read_hexstr@plt>

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

LLVM IR (-O2):
define i32 @mpk_pkginfo_signature_deserialize(i8* %0, i8* %1) {
%3 = tail call i32 @read_hexstr(i8* %0, i32 256, i8* %1)
ret i32 %3
}
int strcmp(const char *s1, const char *s2) {
  while (*s1 == *s2++) {
    if (*s1++ == 0) {
      return (0);
    }
  }
  return (*(unsigned char *)s1 - *(unsigned char *)--s2);
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1159 <strcmp+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1154 <strcmp+0x54>
movl   $0x0,-0x4(%rbp)
jmp    1178 <strcmp+0x78>
jmp    110c <strcmp+0xc>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x18(%rbp)
movzbl -0x1(%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rcx,1),%eax
movzbl (%rsi,%rcx,1),%edx
cmp    %dl,%al
jne    1127 <strcmp+0x27>
add    $0x1,%rcx
test   %eax,%eax
jne    1110 <strcmp+0x10>
xor    %eax,%eax
ret
sub    %edx,%eax
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
br label %6
6: ; preds = %22, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = load i8*, i8** %5
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %5
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %9, %13
br i1 %14, label %15, label %23
15: ; preds = %6
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
%18 = load i8, i8* %16
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %15
store i32 0, i32* %3
br label %32
22: ; preds = %15
br label %6
23: ; preds = %6
%24 = load i8*, i8** %4
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = load i8*, i8** %5
%28 = getelementptr inbounds i8, i8* %27, i32 -1
store i8* %28, i8** %5
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = sub nsw i32 %26, %30
store i32 %31, i32* %3
br label %32
32: ; preds = %23, %21
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
define i32 @strcmp(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %11, %9 ]
%5 = phi i8* [ %1, %2 ], [ %10, %9 ]
%6 = load i8, i8* %4
%7 = load i8, i8* %5
%8 = icmp eq i8 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = getelementptr inbounds i8, i8* %4, i64 1
%12 = icmp eq i8 %6, 0
br i1 %12, label %17, label %3
13: ; preds = %3
%14 = zext i8 %6 to i32
%15 = zext i8 %7 to i32
%16 = sub nsw i32 %14, %15
br label %17
17: ; preds = %9, %13
%18 = phi i32 [ %16, %13 ], [ 0, %9 ]
ret i32 %18
}
int ptrhash(void *a) {
  unsigned *ip = (unsigned *)&a;
  int i;
  unsigned hash = 0;
  for (i = 0; i < sizeof a / sizeof(*ip); i++)
    hash += ip[i];
  return hash;
}


x86 assembly (clang, -O0):
<ptrhash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x2,%rax
jae    114b <ptrhash+0x4b>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111e <ptrhash+0x1e>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptrhash>:
mov    %rdi,%rax
shr    $0x20,%rax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @ptrhash(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i32
%4 = lshr i64 %2, 32
%5 = trunc i64 %4 to i32
%6 = add i32 %5, %3
ret i32 %6
}
char ptr_to_char(char *a) { return *a; }


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

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

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

LLVM IR (-O2):
define signext i8 @ptr_to_char(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
char av_get_pict_type_char(int pict_type) {
  switch (pict_type) {
  case 1:
    return 'I';
  case 2:
    return 'P';
  case 3:
    return 'B';
  case 4:
    return 'S';
  case 5:
    return 'i';
  case 6:
    return 'p';
  default:
    return '?';
  }
}


x86 assembly (clang, -O0):
<av_get_pict_type_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x5,%eax
ja     1166 <av_get_pict_type_char+0x66>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x49,-0x1(%rbp)
jmp    116a <av_get_pict_type_char+0x6a>
movb   $0x50,-0x1(%rbp)
jmp    116a <av_get_pict_type_char+0x6a>
movb   $0x42,-0x1(%rbp)
jmp    116a <av_get_pict_type_char+0x6a>
movb   $0x53,-0x1(%rbp)
jmp    116a <av_get_pict_type_char+0x6a>
movb   $0x69,-0x1(%rbp)
jmp    116a <av_get_pict_type_char+0x6a>
movb   $0x70,-0x1(%rbp)
jmp    116a <av_get_pict_type_char+0x6a>
movb   $0x3f,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_get_pict_type_char>:
lea    -0x8(,%rdi,8),%ecx
mov    %edi,%eax
add    $0xffffffff,%eax
movabs $0x706953425049,%rdx
shr    %cl,%rdx
cmp    $0x6,%eax
mov    $0x3f,%eax
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define signext i8 @av_get_pict_type_char(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %11 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
i32 6, label %10
]
5: ; preds = %1
store i8 73, i8* %2
br label %12
6: ; preds = %1
store i8 80, i8* %2
br label %12
7: ; preds = %1
store i8 66, i8* %2
br label %12
8: ; preds = %1
store i8 83, i8* %2
br label %12
9: ; preds = %1
store i8 105, i8* %2
br label %12
10: ; preds = %1
store i8 112, i8* %2
br label %12
11: ; preds = %1
store i8 63, i8* %2
br label %12
12: ; preds = %11, %10, %9, %8, %7, %6, %5
%13 = load i8, i8* %2
ret i8 %13
}

LLVM IR (-O2):
define signext i8 @av_get_pict_type_char(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 6
%4 = zext i32 %2 to i48
%5 = shl nuw nsw i48 %4, 3
%6 = lshr i48 123597670731849, %5
%7 = trunc i48 %6 to i8
%8 = select i1 %3, i8 %7, i8 63
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ sputline(char *);
int oline() { sputline("serial line from Kmode\n"); }


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"serial line from Kmode\0A\00"
define i32 @oline() {
%1 = alloca i32
%2 = call i32 @sputline(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [24 x i8] c"serial line from Kmode\0A\00"
define i32 @oline() {
%1 = tail call i32 @sputline(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
char *fd2et(string)
char *string;
{
  double dj, tsec, dt;
  dj = fd2jd(string);
  dt = utdt(dj);
  tsec = fd2ts(string);
  tsec = tsec + dt;
  return (ts2fd(tsec));
}


x86 assembly (clang, -O0):
<fd2et>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x1,%al
call   1060 <utdt@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1030 <fd2ts@plt>
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    $0x1,%al
call   1050 <ts2fd@plt>
cltq
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd2et>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1040 <fd2jd@plt>
cvtsi2sd %eax,%xmm0
mov    $0x1,%al
call   1060 <utdt@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <fd2ts@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1050 <ts2fd@plt>
cltq
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @fd2et(i8* %0) {
%2 = alloca i8*
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i8* %0, i8** %2
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %6)
%8 = sitofp i32 %7 to double
store double %8, double* %3
%9 = load double, double* %3
%10 = call i32 (double, ...) bitcast (i32 (...)* @utdt to i32 (double, ...)*)(double %9)
%11 = sitofp i32 %10 to double
store double %11, double* %5
%12 = load i8*, i8** %2
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @fd2ts to i32 (i8*, ...)*)(i8* %12)
%14 = sitofp i32 %13 to double
store double %14, double* %4
%15 = load double, double* %4
%16 = load double, double* %5
%17 = fadd double %15, %16
store double %17, double* %4
%18 = load double, double* %4
%19 = call i32 (double, ...) bitcast (i32 (...)* @ts2fd to i32 (double, ...)*)(double %18)
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i8*
ret i8* %21
}

LLVM IR (-O2):
define i8* @fd2et(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fd2jd to i32 (i8*, ...)*)(i8* %0)
%3 = sitofp i32 %2 to double
%4 = tail call i32 (double, ...) bitcast (i32 (...)* @utdt to i32 (double, ...)*)(double %3)
%5 = sitofp i32 %4 to double
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @fd2ts to i32 (i8*, ...)*)(i8* %0)
%7 = sitofp i32 %6 to double
%8 = fadd double %5, %7
%9 = tail call i32 (double, ...) bitcast (i32 (...)* @ts2fd to i32 (double, ...)*)(double %8)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i8*
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  int i, j, k;
  do {
    if (i == 1)
      for (j = 0; j < k; k++)
        printf("1\n");
    if (i == 2)
      printf("2\n");
  } while (i != 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x14(%rbp)
jne    1162 <main+0x52>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    115d <main+0x4d>
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1137 <main+0x27>
jmp    1162 <main+0x52>
cmpl   $0x2,-0x14(%rbp)
jne    1178 <main+0x68>
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
jmp    117d <main+0x6d>
cmpl   $0x3,-0x14(%rbp)
jne    1126 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"1\0A\00"
@.str.1 = [3 x i8] c"2\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %9
9: ; preds = %29, %2
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %23
12: ; preds = %9
store i32 0, i32* %7
br label %13
13: ; preds = %19, %12
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17
%20 = load i32, i32* %8
%21 = add nsw i32 %20, 1
store i32 %21, i32* %8
br label %13
22: ; preds = %13
br label %23
23: ; preds = %22, %9
%24 = load i32, i32* %6
%25 = icmp eq i32 %24, 2
br i1 %25, label %26, label %28
26: ; preds = %23
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
br label %29
29: ; preds = %28
%30 = load i32, i32* %6
%31 = icmp ne i32 %30, 3
br i1 %31, label %9, label %32
32: ; preds = %29
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _hmt_register_covercase(char *, char *);
void _hmt_covercase_HMM_DivideVec3f_init(void) {
  _hmt_register_covercase("HMM_DivideVec3f", "1");
}


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

x86 assembly (clang, -O2):
<_hmt_covercase_HMM_DivideVec3f_init>:
lea    0xee9(%rip),%rdi
lea    0xef2(%rip),%rsi
jmp    1030 <_hmt_register_covercase@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"HMM_DivideVec3f\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_DivideVec3f_init() {
%1 = call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"HMM_DivideVec3f\00"
@.str.1 = [2 x i8] c"1\00"
define void @_hmt_covercase_HMM_DivideVec3f_init() {
%1 = tail call i32 @_hmt_register_covercase(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int Kit_CubeRemLit(unsigned int, int);
unsigned Kit_CubeUnmark(unsigned uCube) { return Kit_CubeRemLit(uCube, 31); }


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

x86 assembly (clang, -O2):
<Kit_CubeUnmark>:
mov    $0x1f,%esi
jmp    1030 <Kit_CubeRemLit@plt>

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

LLVM IR (-O2):
define i32 @Kit_CubeUnmark(i32 %0) {
%2 = tail call i32 @Kit_CubeRemLit(i32 %0, i32 31)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ clear_sip(void *);
void iprange_free_fn(void *setting) { clear_sip(setting); }


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

x86 assembly (clang, -O2):
<iprange_free_fn>:
jmp    1030 <clear_sip@plt>

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

LLVM IR (-O2):
define void @iprange_free_fn(i8* %0) {
%2 = tail call i32 @clear_sip(i8* %0)
ret void
}
int test_imm_53int16_mem(short *val) {
  return ((*val) & (-0x53 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_53int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -83
%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_53int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -83
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int /*<<< orphan*/ dbg_set_chain(int /*<<< orphan*/);
int /*<<< orphan*/ get_response_from_vpi();
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ send_address_to_vpi(int);
int /*<<< orphan*/ send_command_to_vpi(int);
int /*<<< orphan*/ send_data_to_vpi(int);
int dbg_wb_write8(uint32_t adr, uint8_t data) {
  if (0)
    printf("dbg_wb_write8: adr 0x%.8x data 0x%.2x\n", adr, data);
  dbg_set_chain(0);
  send_command_to_vpi(0x7);
  send_address_to_vpi(adr);
  send_data_to_vpi(sizeof(data));
  send_data_to_vpi(data);
  get_response_from_vpi();
  return 0;
}


x86 assembly (clang, -O0):
<dbg_wb_write8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %edi,%edi
call   1050 <dbg_set_chain@plt>
mov    $0x7,%edi
call   1030 <send_command_to_vpi@plt>
mov    -0x4(%rbp),%edi
call   1040 <send_address_to_vpi@plt>
mov    $0x4,%edi
call   1070 <send_data_to_vpi@plt>
mov    -0x8(%rbp),%edi
call   1070 <send_data_to_vpi@plt>
mov    $0x0,%al
call   1060 <get_response_from_vpi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dbg_wb_write8>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
call   1050 <dbg_set_chain@plt>
mov    $0x7,%edi
call   1030 <send_command_to_vpi@plt>
mov    %ebp,%edi
call   1040 <send_address_to_vpi@plt>
mov    $0x4,%edi
call   1070 <send_data_to_vpi@plt>
mov    %ebx,%edi
call   1070 <send_data_to_vpi@plt>
xor    %eax,%eax
call   1060 <get_response_from_vpi@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @dbg_wb_write8(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @dbg_set_chain(i32 0)
%6 = call i32 @send_command_to_vpi(i32 7)
%7 = load i32, i32* %3
%8 = call i32 @send_address_to_vpi(i32 %7)
%9 = call i32 @send_data_to_vpi(i32 4)
%10 = load i32, i32* %4
%11 = call i32 @send_data_to_vpi(i32 %10)
%12 = call i32 (...) @get_response_from_vpi()
ret i32 0
}

LLVM IR (-O2):
define i32 @dbg_wb_write8(i32 %0, i32 %1) {
%3 = tail call i32 @dbg_set_chain(i32 0)
%4 = tail call i32 @send_command_to_vpi(i32 7)
%5 = tail call i32 @send_address_to_vpi(i32 %0)
%6 = tail call i32 @send_data_to_vpi(i32 4)
%7 = tail call i32 @send_data_to_vpi(i32 %1)
%8 = tail call i32 (...) @get_response_from_vpi()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int foo(int);
int main() {
  if (foo(1 << 3) != 0)
    abort();
  if (foo(0) != 1)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1040 <foo@plt>
cmp    $0x0,%eax
je     1159 <main+0x29>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <foo@plt>
cmp    $0x1,%eax
je     1170 <main+0x40>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x8,%edi
call   1040 <foo@plt>
test   %eax,%eax
jne    1152 <main+0x22>
xor    %edi,%edi
call   1040 <foo@plt>
cmp    $0x1,%eax
jne    1152 <main+0x22>
xor    %edi,%edi
call   1050 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 8)
%3 = icmp ne i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @abort()
unreachable
6: ; preds = %0
%7 = call i32 @foo(i32 0)
%8 = icmp ne i32 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @abort()
unreachable
11: ; preds = %6
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 8)
%2 = icmp eq i32 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @abort()
unreachable
5: ; preds = %0
%6 = tail call i32 @foo(i32 0)
%7 = icmp eq i32 %6, 1
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %5
%11 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
double atof(char const *);
int numcmp(const char *s1, const char *s2) {
  double v1, v2;
  v1 = atof(s1);
  v2 = atof(s2);
  if (v1 < v2) {
    return -1;
  } else if (v1 > v2) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<numcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115c <numcmp+0x4c>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <numcmp+0x6f>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1178 <numcmp+0x68>
movl   $0x1,-0x4(%rbp)
jmp    117f <numcmp+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1030 <atof@plt>
xor    %ecx,%ecx
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
seta   %cl
ucomisd %xmm1,%xmm0
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @numcmp(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call double @atof(i8* %8)
store double %9, double* %6
%10 = load i8*, i8** %5
%11 = call double @atof(i8* %10)
store double %11, double* %7
%12 = load double, double* %6
%13 = load double, double* %7
%14 = fcmp olt double %12, %13
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 -1, i32* %3
br label %22
16: ; preds = %2
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fcmp ogt double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %3
br label %22
21: ; preds = %16
store i32 0, i32* %3
br label %22
22: ; preds = %21, %20, %15
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @numcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call double @atof(i8* %0)
%4 = tail call double @atof(i8* %1)
%5 = fcmp olt double %3, %4
%6 = fcmp ogt double %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}
void pstring(s, len) char *s;
int len;
{
  while (*s)
    if (len--)
      putchar(*s++);
    else
      break;
}


x86 assembly (clang, -O0):
<pstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1168 <pstring+0x58>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     115e <pstring+0x4e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    1163 <pstring+0x53>
jmp    1168 <pstring+0x58>
jmp    111f <pstring+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstring>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     114f <pstring+0x3f>
test   %esi,%esi
je     114f <pstring+0x3f>
mov    %rdi,%r14
mov    %esi,%r15d
mov    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
movzbl (%r14,%rbx,1),%eax
test   %al,%al
je     114f <pstring+0x3f>
lea    0x1(%rbx),%rcx
cmp    %ebx,%r15d
mov    %rcx,%rbx
jne    1130 <pstring+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @pstring(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %20, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %21
9: ; preds = %5
%10 = load i32, i32* %4
%11 = add nsw i32 %10, -1
store i32 %11, i32* %4
%12 = icmp ne i32 %10, 0
br i1 %12, label %13, label %19
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
%16 = load i8, i8* %14
%17 = sext i8 %16 to i32
%18 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %17)
br label %20
19: ; preds = %9
br label %21
20: ; preds = %13
br label %5
21: ; preds = %19, %5
ret void
}

LLVM IR (-O2):
define void @pstring(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
%5 = icmp eq i32 %1, 0
%6 = or i1 %4, %5
br i1 %6, label %19, label %7
7: ; preds = %2, %7
%8 = phi i8 [ %15, %7 ], [ %3, %2 ]
%9 = phi i32 [ %11, %7 ], [ %1, %2 ]
%10 = phi i8* [ %12, %7 ], [ %0, %2 ]
%11 = add nsw i32 %9, -1
%12 = getelementptr inbounds i8, i8* %10, i64 1
%13 = sext i8 %8 to i32
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %13)
%15 = load i8, i8* %12
%16 = icmp eq i8 %15, 0
%17 = icmp eq i32 %11, 0
%18 = select i1 %16, i1 true, i1 %17
br i1 %18, label %19, label %7
19: ; preds = %7, %2
ret void
}
/* Variables and functions */
bool nrf51_errata_1(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_1() {
ret i32 0
}
int hash_code_string(void *a) {
  int re = 0;
  char *aa = (char *)a;
  while (*aa) {
    re += 31 * *aa;
    aa++;
  }
  return re;
}


x86 assembly (clang, -O0):
<hash_code_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <hash_code_string+0x45>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
imul   $0x1f,%eax,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1117 <hash_code_string+0x17>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_code_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash_code_string+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
mov    %ecx,%edx
shl    $0x5,%edx
sub    %ecx,%edx
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_code_string+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @hash_code_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
store i32 0, i32* %3
%5 = load i8*, i8** %2
store i8* %5, i8** %4
br label %6
6: ; preds = %10, %1
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %6
%11 = load i8*, i8** %4
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = mul nsw i32 31, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, %14
store i32 %16, i32* %3
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %4
br label %6
19: ; preds = %6
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @hash_code_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %11, %4 ], [ %0, %1 ]
%7 = phi i32 [ %10, %4 ], [ 0, %1 ]
%8 = sext i8 %5 to i32
%9 = mul nsw i32 %8, 31
%10 = add nsw i32 %9, %7
%11 = getelementptr inbounds i8, i8* %6, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %15
}
/* Type definitions */
typedef int /*<<< orphan*/ OTHERNAME;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int /*<<< orphan*/ ASN1_item_free(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ OTHERNAME_it;
void OTHERNAME_free(OTHERNAME *a) {
  ASN1_item_free((ASN1_VALUE *)a, &OTHERNAME_it);
}


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

x86 assembly (clang, -O2):
<OTHERNAME_free>:
mov    0x2ec9(%rip),%rsi
jmp    1030 <ASN1_item_free@plt>

LLVM IR (-O0):
@OTHERNAME_it = global i32 0
define void @OTHERNAME_free(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @ASN1_item_free(i32* %3, i32* @OTHERNAME_it)
ret void
}

LLVM IR (-O2):
@OTHERNAME_it = global i32 0
define void @OTHERNAME_free(i32* %0) {
%2 = tail call i32 @ASN1_item_free(i32* %0, i32* @OTHERNAME_it)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main(void) {
  int i;
  int *x = malloc(1024);
  free(x);
  malloc(512);
  for (i = 0; i < 350; i++) {
    int *y = malloc(256);
    free(y);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    $0x200,%edi
call   1040 <malloc@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x15e,-0x8(%rbp)
jge    1189 <main+0x69>
mov    $0x100,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1157 <main+0x37>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x400,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
mov    $0x200,%edi
call   1040 <malloc@plt>
mov    $0x15e,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0x100,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
add    $0xffffffff,%ebx
jne    1150 <main+0x30>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
store i32 0, i32* %1
%5 = call i32* @malloc(i32 1024)
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @free(i32* %6)
%8 = call i32* @malloc(i32 512)
store i32 0, i32* %2
br label %9
9: ; preds = %16, %0
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 350
br i1 %11, label %12, label %19
12: ; preds = %9
%13 = call i32* @malloc(i32 256)
store i32* %13, i32** %4
%14 = load i32*, i32** %4
%15 = call i32 @free(i32* %14)
br label %16
16: ; preds = %12
%17 = load i32, i32* %2
%18 = add nsw i32 %17, 1
store i32 %18, i32* %2
br label %9
19: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 1024)
%2 = tail call i32 @free(i32* %1)
%3 = tail call i32* @malloc(i32 512)
br label %4
4: ; preds = %0, %4
%5 = phi i32 [ 0, %0 ], [ %8, %4 ]
%6 = tail call i32* @malloc(i32 256)
%7 = tail call i32 @free(i32* %6)
%8 = add nuw nsw i32 %5, 1
%9 = icmp eq i32 %8, 350
br i1 %9, label %10, label %4
10: ; preds = %4
ret i32 0
}
void SC_DO_NOTHING(void) { return; }


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

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

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

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