xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(int);
unsigned char flags_retrieve_byte(unsigned char p_flag, unsigned char pos) {
  assert(pos >= 0 && pos <= 7);
  unsigned char value = 0;
  unsigned char to_or = (0b00000000 | pos);
  value = ((p_flag & to_or) != 0);
  return value;
}


x86 assembly (clang, -O0):
<flags_retrieve_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x5(%rbp)
jl     1143 <flags_retrieve_byte+0x33>
movzbl -0x2(%rbp),%eax
cmp    $0x7,%eax
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movb   $0x0,-0x3(%rbp)
movzbl -0x2(%rbp),%eax
or     $0x0,%eax
mov    %al,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x4(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flags_retrieve_byte>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x8,%bl
setb   %dil
call   1030 <assert@plt>
test   %ebp,%ebx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @flags_retrieve_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8, i8* %4
%12 = zext i8 %11 to i32
%13 = icmp sle i32 %12, 7
br label %14
14: ; preds = %10, %2
%15 = phi i1 [ false, %2 ], [ %13, %10 ]
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
store i8 0, i8* %5
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 0, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %6
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = load i8, i8* %6
%25 = zext i8 %24 to i32
%26 = and i32 %23, %25
%27 = icmp ne i32 %26, 0
%28 = zext i1 %27 to i32
%29 = trunc i32 %28 to i8
store i8 %29, i8* %5
%30 = load i8, i8* %5
ret i8 %30
}

LLVM IR (-O2):
define zeroext i8 @flags_retrieve_byte(i8 zeroext %0, i8 zeroext %1) {
%3 = icmp ult i8 %1, 8
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = and i8 %1, %0
%7 = icmp ne i8 %6, 0
%8 = zext i1 %7 to i8
ret i8 %8
}
void d2i_X509_EXTENSIONS(void) {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @RTC_EveryHourHandler() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int try_parse_int_imp(char *, void *, int, int);
bool try_parse_uint32(char *str, uint32_t *value_ptr) {
  return try_parse_int_imp(str, (void *)value_ptr, sizeof(uint32_t), false);
}


x86 assembly (clang, -O0):
<try_parse_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1030 <try_parse_int_imp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<try_parse_uint32>:
mov    $0x4,%edx
xor    %ecx,%ecx
jmp    1030 <try_parse_int_imp@plt>

LLVM IR (-O0):
define i32 @try_parse_uint32(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = bitcast i32* %6 to i8*
%8 = call i32 @try_parse_int_imp(i8* %5, i8* %7, i32 4, i32 0)
ret i32 %8
}

LLVM IR (-O2):
define i32 @try_parse_uint32(i8* %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @try_parse_int_imp(i8* %0, i8* %3, i32 4, i32 0)
ret i32 %4
}
int logicalShift(int x, int n) {
  n && (x = x >> n) & (x = (~((~(0)) << (32 + ~n + 1))) & x);
  return x;
}


x86 assembly (clang, -O0):
<logicalShift>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     114d <logicalShift+0x4d>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%ecx
xor    $0xffffffff,%ecx
add    $0x20,%ecx
add    $0x1,%ecx
mov    $0xffffffff,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    -0x4(%rbp),%ecx
mov    %ecx,-0x4(%rbp)
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<logicalShift>:
mov    %edi,%eax
test   %esi,%esi
je     1117 <logicalShift+0x17>
mov    %esi,%ecx
sar    %cl,%eax
neg    %cl
mov    $0xffffffff,%edx
shl    %cl,%edx
not    %edx
and    %edx,%eax
ret

LLVM IR (-O0):
define i32 @logicalShift(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %21
7: ; preds = %2
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = ashr i32 %8, %9
store i32 %10, i32* %3
%11 = load i32, i32* %4
%12 = xor i32 %11, -1
%13 = add nsw i32 32, %12
%14 = add nsw i32 %13, 1
%15 = shl i32 -1, %14
%16 = xor i32 %15, -1
%17 = load i32, i32* %3
%18 = and i32 %16, %17
store i32 %18, i32* %3
%19 = and i32 %10, %18
%20 = icmp ne i32 %19, 0
br label %21
21: ; preds = %7, %2
%22 = phi i1 [ false, %2 ], [ %20, %7 ]
%23 = zext i1 %22 to i32
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @logicalShift(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = ashr i32 %0, %1
%6 = sub i32 32, %1
%7 = shl nsw i32 -1, %6
%8 = xor i32 %7, -1
%9 = and i32 %5, %8
br label %10
10: ; preds = %4, %2
%11 = phi i32 [ %9, %4 ], [ %0, %2 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
unsigned char CheckId_OV7725(void) {
  unsigned char temp1;
  unsigned char temp2;
  VIM_SIF_I2cReadByte(0x0a, &temp1);
  VIM_SIF_I2cReadByte(0x0b, &temp2);
  if ((temp1 == 0x77) && (temp2 == 0x21))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<CheckId_OV7725>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xa,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    $0xb,%edi
lea    -0x3(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
cmp    $0x77,%eax
jne    1157 <CheckId_OV7725+0x47>
movzbl -0x3(%rbp),%eax
cmp    $0x21,%eax
jne    1157 <CheckId_OV7725+0x47>
movb   $0x1,-0x1(%rbp)
jmp    115b <CheckId_OV7725+0x4b>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckId_OV7725>:
push   %rax
lea    0x7(%rsp),%rsi
mov    $0xa,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
lea    0x6(%rsp),%rsi
mov    $0xb,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
mov    0x7(%rsp),%al
xor    $0x77,%al
mov    0x6(%rsp),%cl
xor    $0x21,%cl
or     %al,%cl
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @CheckId_OV7725() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = call i32 @VIM_SIF_I2cReadByte(i32 10, i8* %2)
%5 = call i32 @VIM_SIF_I2cReadByte(i32 11, i8* %3)
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 119
br i1 %8, label %9, label %14
9: ; preds = %0
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = icmp eq i32 %11, 33
br i1 %12, label %13, label %14
13: ; preds = %9
store i8 1, i8* %1
br label %15
14: ; preds = %9, %0
store i8 0, i8* %1
br label %15
15: ; preds = %14, %13
%16 = load i8, i8* %1
ret i8 %16
}

LLVM IR (-O2):
define zeroext i8 @CheckId_OV7725() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 10, i8* %1)
%4 = call i32 @VIM_SIF_I2cReadByte(i32 11, i8* %2)
%5 = load i8, i8* %1
%6 = icmp eq i8 %5, 119
%7 = load i8, i8* %2
%8 = icmp eq i8 %7, 33
%9 = select i1 %6, i1 %8, i1 false
%10 = zext i1 %9 to i8
ret i8 %10
}
int cycle_may_fetch_c(unsigned int flags) {
  return (flags & 0x00008000) ? 1 : 0;
}


x86 assembly (clang, -O0):
<cycle_may_fetch_c>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x8000,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cycle_may_fetch_c>:
mov    %edi,%eax
shr    $0xf,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @cycle_may_fetch_c(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 32768
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 1, i32 0
ret i32 %7
}

LLVM IR (-O2):
define i32 @cycle_may_fetch_c(i32 %0) {
%2 = lshr i32 %0, 15
%3 = and i32 %2, 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ printf(char *, int);
int syscall(int /*<<< orphan*/);
int main() {
  int id = syscall(SYS_gettid);
  printf("gettid: %d\n", id);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
call   1040 <syscall@plt>
lea    0xeca(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@SYS_gettid = global i32 0
@.str = [12 x i8] c"gettid: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @SYS_gettid
%4 = call i32 @syscall(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
@.str = [12 x i8] c"gettid: %d\0A\00"
define i32 @main() {
%1 = load i32, i32* @SYS_gettid
%2 = tail call i32 @syscall(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ die(char *);
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *xstrdup(const char *s) {
  size_t n;
  char *r;
  n = strlen(s) + 1;
  r = malloc(n);
  if (r == NULL) {
    die("unable to allocate memory");
  }
  memcpy(r, s, n);
  return r;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1182 <xstrdup+0x42>
lea    0xe83(%rip),%rdi
call   1060 <die@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    116f <xstrdup+0x2f>
lea    0xe96(%rip),%rdi
call   1060 <die@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [26 x i8] c"unable to allocate memory\00"
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %1
%16 = load i8*, i8** %4
%17 = load i8*, i8** %2
%18 = load i64, i64* %3
%19 = call i32 @memcpy(i8* %16, i8* %17, i64 %18)
%20 = load i8*, i8** %4
ret i8* %20
}

LLVM IR (-O2):
@.str = [26 x i8] c"unable to allocate memory\00"
define i8* @xstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = tail call i32 @die(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
void foo(char *p) {
  p = __builtin_assume_aligned(p, 64);
  __builtin_memset(p, 0, 0x100000001ULL);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
movabs $0x100000001,%rdx
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
movabs $0x100000001,%rdx
xor    %esi,%esi
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @foo(i8* %0) {
tail call void @llvm.memset.p0i8.i64(i8* align 64 dereferenceable(4294967297) %0, i8 0, i64 4294967297, i1 false)
ret void
}
void uart_init(void) {
  (*(volatile unsigned long *)0xE0200000) = 0x22222222;
  (*(volatile unsigned long *)0xE0200020) = 0x2222;
  (*(volatile unsigned long *)0xE2900808) = 0x1;
  (*(volatile unsigned long *)0xE290080C) = 0x0;
  (*(volatile unsigned long *)0xE2900800) = 0x3;
  (*(volatile unsigned long *)0xE2900804) = 0x5;
  (*(volatile unsigned long *)0xE2900828) = 35;
  (*(volatile unsigned long *)0xE290082C) = 0x1;
}


x86 assembly (clang, -O0):
<uart_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0200000,%eax
movq   $0x22222222,(%rax)
mov    $0xe0200020,%eax
movq   $0x2222,(%rax)
mov    $0xe2900808,%eax
movq   $0x1,(%rax)
mov    $0xe290080c,%eax
movq   $0x0,(%rax)
mov    $0xe2900800,%eax
movq   $0x3,(%rax)
mov    $0xe2900804,%eax
movq   $0x5,(%rax)
mov    $0xe2900828,%eax
movq   $0x23,(%rax)
mov    $0xe290082c,%eax
movq   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_init>:
mov    $0xe0200000,%eax
movq   $0x22222222,(%rax)
movq   $0x2222,0x20(%rax)
movq   $0x1,0x2700808(%rax)
movq   $0x0,0x270080c(%rax)
movq   $0x3,0x2700800(%rax)
movq   $0x5,0x2700804(%rax)
movq   $0x23,0x2700828(%rax)
movq   $0x1,0x270082c(%rax)
ret

LLVM IR (-O0):
define void @uart_init() {
store volatile i64 572662306, i64* inttoptr (i64 3760193536 to i64*)
store volatile i64 8738, i64* inttoptr (i64 3760193568 to i64*)
store volatile i64 1, i64* inttoptr (i64 3801090056 to i64*)
store volatile i64 0, i64* inttoptr (i64 3801090060 to i64*)
store volatile i64 3, i64* inttoptr (i64 3801090048 to i64*)
store volatile i64 5, i64* inttoptr (i64 3801090052 to i64*)
store volatile i64 35, i64* inttoptr (i64 3801090088 to i64*)
store volatile i64 1, i64* inttoptr (i64 3801090092 to i64*)
ret void
}

LLVM IR (-O2):
define void @uart_init() {
store volatile i64 572662306, i64* inttoptr (i64 3760193536 to i64*)
store volatile i64 8738, i64* inttoptr (i64 3760193568 to i64*)
store volatile i64 1, i64* inttoptr (i64 3801090056 to i64*)
store volatile i64 0, i64* inttoptr (i64 3801090060 to i64*)
store volatile i64 3, i64* inttoptr (i64 3801090048 to i64*)
store volatile i64 5, i64* inttoptr (i64 3801090052 to i64*)
store volatile i64 35, i64* inttoptr (i64 3801090088 to i64*)
store volatile i64 1, i64* inttoptr (i64 3801090092 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int helloworld(void) {
  printf("Hello World\n");
  return (0);
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @helloworld() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ handle_44(int /*<<< orphan*/);
int gen_44() {
  handle_44(0);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @gen_44() {
%1 = tail call i32 @handle_44(i32 0)
ret i32 0
}
void SteamAPI_vr_IVRCompositor_CompositorQuit(void *self) {
  xlogf("%s(self = %p)\n", __func__, self);
}


x86 assembly (clang, -O0):
<SteamAPI_vr_IVRCompositor_CompositorQuit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0xed9(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <xlogf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SteamAPI_vr_IVRCompositor_CompositorQuit>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
jmp    1030 <xlogf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_vr_IVRCompositor_CompositorQuit = [41 x i8] c"SteamAPI_vr_IVRCompositor_CompositorQuit\00"
define void @SteamAPI_vr_IVRCompositor_CompositorQuit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @__func__.SteamAPI_vr_IVRCompositor_CompositorQuit, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s(self = %p)\0A\00"
@__func__.SteamAPI_vr_IVRCompositor_CompositorQuit = [41 x i8] c"SteamAPI_vr_IVRCompositor_CompositorQuit\00"
define void @SteamAPI_vr_IVRCompositor_CompositorQuit(i8* %0) {
%2 = tail call i32 (i8*, i8*, i8*, ...) bitcast (i32 (...)* @xlogf to i32 (i8*, i8*, i8*, ...)*)(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @__func__.SteamAPI_vr_IVRCompositor_CompositorQuit, i64 0, i64 0), i8* %0)
ret void
}
int is_in_bound(int *arr, int size, int *ptr) {
  if (ptr >= arr && ptr < (arr + size))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_in_bound>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jb     1145 <is_in_bound+0x45>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jae    1145 <is_in_bound+0x45>
movl   $0x1,-0x4(%rbp)
jmp    114c <is_in_bound+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_in_bound>:
cmp    %rdi,%rdx
setae  %al
movslq %esi,%rcx
lea    (%rdi,%rcx,4),%rcx
cmp    %rdx,%rcx
seta   %cl
and    %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @is_in_bound(i32* readnone %0, i32 %1, i32* readnone %2) {
%4 = icmp uge i32* %2, %0
%5 = sext i32 %1 to i64
%6 = getelementptr inbounds i32, i32* %0, i64 %5
%7 = icmp ugt i32* %6, %2
%8 = select i1 %4, i1 %7, i1 false
%9 = zext i1 %8 to i32
ret i32 %9
}
double exp(double x) {
  __asm("fldl2e ; fmulp ; f2xm1" : "+t"(x));
  return x + 1;
}


x86 assembly (clang, -O0):
<exp>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
fldl   -0x10(%rbp)
fldl2e
fmulp  %st,%st(1)
f2xm1
fstpl  -0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xecf(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp>:
movsd  %xmm0,-0x8(%rsp)
fldl   -0x8(%rsp)
fldl2e
fmulp  %st,%st(1)
f2xm1
fstpl  -0x10(%rsp)
movsd  -0x10(%rsp),%xmm0
addsd  0xede(%rip),%xmm0
ret

LLVM IR (-O0):
define double @exp(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double asm "fldl2e ; fmulp ; f2xm1", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %3)
store double %4, double* %2
%5 = load double, double* %2
%6 = fadd double %5, 1.000000e+00
ret double %6
}

LLVM IR (-O2):
define double @exp(double %0) {
%2 = tail call double asm "fldl2e ; fmulp ; f2xm1", "={st},0,~{dirflag},~{fpsr},~{flags}"(double %0)
%3 = fadd double %2, 1.000000e+00
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
needlval() { error("must be lvalue"); }


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

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

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

LLVM IR (-O2):
@.str = [15 x i8] c"must be lvalue\00"
define i32 @needlval() {
%1 = tail call i32 @error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void arena_free(void *ptr) { (void)ptr; }


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

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

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

LLVM IR (-O2):
define void @arena_free(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_message(int);
void *get_message_thread(void *_socket) {
  int socket = *(int *)_socket;
  while (1)
    get_message(socket);
  return NULL;
}


x86 assembly (clang, -O0):
<get_message_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <get_message@plt>
jmp    1125 <get_message_thread+0x15>

x86 assembly (clang, -O2):
<get_message_thread>:
push   %rbx
mov    (%rdi),%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <get_message@plt>
jmp    1120 <get_message_thread+0x10>

LLVM IR (-O0):
define i8* @get_message_thread(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %3
br label %7
7: ; preds = %1, %7
%8 = load i32, i32* %3
%9 = call i32 @get_message(i32 %8)
br label %7
}

LLVM IR (-O2):
define noalias i8* @get_message_thread(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
br label %4
4: ; preds = %4, %1
%5 = tail call i32 @get_message(i32 %3)
br label %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t ip_get_flag_reservered(const uint8_t *p_ip) { return (p_ip[6] & 0x80); }


x86 assembly (clang, -O0):
<ip_get_flag_reservered>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
and    $0x80,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip_get_flag_reservered>:
mov    $0x80,%eax
and    0x18(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @ip_get_flag_reservered(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 6
%5 = load i32, i32* %4
%6 = and i32 %5, 128
ret i32 %6
}

LLVM IR (-O2):
define i32 @ip_get_flag_reservered(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
%4 = and i32 %3, 128
ret i32 %4
}
int BS2PP_CheckIncludeHashNext(int hash) {
  return (((hash * 251) >> 8) & 4095);
}


x86 assembly (clang, -O0):
<BS2PP_CheckIncludeHashNext>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
imul   $0xfb,-0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xfff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BS2PP_CheckIncludeHashNext>:
imul   $0xfb,%edi,%eax
shr    $0x8,%eax
and    $0xfff,%eax
ret

LLVM IR (-O0):
define i32 @BS2PP_CheckIncludeHashNext(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 251
%5 = ashr i32 %4, 8
%6 = and i32 %5, 4095
ret i32 %6
}

LLVM IR (-O2):
define i32 @BS2PP_CheckIncludeHashNext(i32 %0) {
%2 = mul nsw i32 %0, 251
%3 = lshr i32 %2, 8
%4 = and i32 %3, 4095
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ send_binthres();
int /*<<< orphan*/ send_brightness();
int /*<<< orphan*/ send_canny();
int /*<<< orphan*/ send_expvalue();
int /*<<< orphan*/ send_gamma();
int /*<<< orphan*/ send_magnitude();
int /*<<< orphan*/ send_mode();
int /*<<< orphan*/ send_speed();
int /*<<< orphan*/ send_threshold();
int /*<<< orphan*/ send_unitaryVectors();
void send_all() {
  send_magnitude();
  send_unitaryVectors();
  send_threshold();
  send_brightness();
  send_gamma();
  send_expvalue();
  send_binthres();
  send_canny();
  send_mode();
  send_speed();
}


x86 assembly (clang, -O0):
<send_all>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1090 <send_magnitude@plt>
mov    $0x0,%al
call   10a0 <send_unitaryVectors@plt>
mov    $0x0,%al
call   10b0 <send_threshold@plt>
mov    $0x0,%al
call   1060 <send_brightness@plt>
mov    $0x0,%al
call   1040 <send_gamma@plt>
mov    $0x0,%al
call   1030 <send_expvalue@plt>
mov    $0x0,%al
call   1080 <send_binthres@plt>
mov    $0x0,%al
call   10c0 <send_canny@plt>
mov    $0x0,%al
call   1070 <send_mode@plt>
mov    $0x0,%al
call   1050 <send_speed@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_all>:
push   %rax
xor    %eax,%eax
call   1090 <send_magnitude@plt>
xor    %eax,%eax
call   10a0 <send_unitaryVectors@plt>
xor    %eax,%eax
call   10b0 <send_threshold@plt>
xor    %eax,%eax
call   1060 <send_brightness@plt>
xor    %eax,%eax
call   1040 <send_gamma@plt>
xor    %eax,%eax
call   1030 <send_expvalue@plt>
xor    %eax,%eax
call   1080 <send_binthres@plt>
xor    %eax,%eax
call   10c0 <send_canny@plt>
xor    %eax,%eax
call   1070 <send_mode@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <send_speed@plt>

LLVM IR (-O0):
define void @send_all() {
%1 = call i32 (...) @send_magnitude()
%2 = call i32 (...) @send_unitaryVectors()
%3 = call i32 (...) @send_threshold()
%4 = call i32 (...) @send_brightness()
%5 = call i32 (...) @send_gamma()
%6 = call i32 (...) @send_expvalue()
%7 = call i32 (...) @send_binthres()
%8 = call i32 (...) @send_canny()
%9 = call i32 (...) @send_mode()
%10 = call i32 (...) @send_speed()
ret void
}

LLVM IR (-O2):
define void @send_all() {
%1 = tail call i32 (...) @send_magnitude()
%2 = tail call i32 (...) @send_unitaryVectors()
%3 = tail call i32 (...) @send_threshold()
%4 = tail call i32 (...) @send_brightness()
%5 = tail call i32 (...) @send_gamma()
%6 = tail call i32 (...) @send_expvalue()
%7 = tail call i32 (...) @send_binthres()
%8 = tail call i32 (...) @send_canny()
%9 = tail call i32 (...) @send_mode()
%10 = tail call i32 (...) @send_speed()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char str[15] = "hello world";
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x13(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x5(%rbp)
lea    -0x13(%rbp),%rsi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movabs $0x6f77206f6c6c6568,%rax
20 77 6f
mov    %rax,0x8(%rsp)
movq   $0x646c726f,0xf(%rsp)
6c 64
lea    0xedc(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [15 x i8] c"hello world\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
store i32 0, i32* %1
%3 = bitcast [15 x i8]* %2 to i8*
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [15 x i8] c"hello world\00\00\00\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
void gdk_image_get_pixel() {}


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

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

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

LLVM IR (-O2):
define void @gdk_image_get_pixel() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void MPURegionDisable(unsigned long ulRegion) {
  DEBUG_ASSERT(ulRegion < 8);
  (*((volatile unsigned long *)(0xE000ED98))) = ulRegion;
  (*((volatile unsigned long *)(0xE000EDA0))) &= ~0x00000001;
}


x86 assembly (clang, -O0):
<MPURegionDisable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x8,-0x8(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rcx
mov    $0xe000ed98,%eax
mov    %rcx,(%rax)
mov    $0xe000eda0,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0xe000eda0,%eax
mov    %rcx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MPURegionDisable>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x8,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    $0xe000eda0,%eax
mov    %rbx,-0x8(%rax)
andq   $0xfffffffffffffffe,(%rax)
pop    %rbx
ret

LLVM IR (-O0):
define void @MPURegionDisable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ult i64 %3, 8
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
store volatile i64 %7, i64* inttoptr (i64 3758157208 to i64*)
%8 = load volatile i64, i64* inttoptr (i64 3758157216 to i64*)
%9 = and i64 %8, -2
store volatile i64 %9, i64* inttoptr (i64 3758157216 to i64*)
ret void
}

LLVM IR (-O2):
define void @MPURegionDisable(i64 %0) {
%2 = icmp ult i64 %0, 8
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
store volatile i64 %0, i64* inttoptr (i64 3758157208 to i64*)
%5 = load volatile i64, i64* inttoptr (i64 3758157216 to i64*)
%6 = and i64 %5, -2
store volatile i64 %6, i64* inttoptr (i64 3758157216 to i64*)
ret void
}
int push(int i) { return i; }


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

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

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

LLVM IR (-O2):
define i32 @push(i32 returned %0) {
ret i32 %0
}
int dwc3_exynos_vbus_event(struct device *dev, int state) { return 0; }


x86 assembly (clang, -O0):
<dwc3_exynos_vbus_event>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.device = type opaque
define i32 @dwc3_exynos_vbus_event(%struct.device* %0, i32 %1) {
%3 = alloca %struct.device*
%4 = alloca i32
store %struct.device* %0, %struct.device** %3
store i32 %1, i32* %4
ret i32 0
}

LLVM IR (-O2):
%struct.device = type opaque
define i32 @dwc3_exynos_vbus_event(%struct.device* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned long);
int /*<<< orphan*/ pthread_exit(void *);
scalar_t__ pthread_self();
void *inv_thr_fn2(void *arg) {
  printf("thread 2: ID is %lu\n", (unsigned long)pthread_self());
  pthread_exit((void *)0);
}


x86 assembly (clang, -O0):
<inv_thr_fn2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <pthread_self@plt>
mov    %rax,%rsi
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_thr_fn2>:
push   %rax
xor    %eax,%eax
call   1050 <pthread_self@plt>
lea    0xec1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"thread 2: ID is %lu\0A\00"
define i8* @inv_thr_fn2(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i64 (...) @pthread_self()
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %4)
%6 = call i32 @pthread_exit(i8* null)
%7 = load i8*, i8** %2
ret i8* %7
}

LLVM IR (-O2):
@.str = [21 x i8] c"thread 2: ID is %lu\0A\00"
define noalias i8* @inv_thr_fn2(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %2)
%4 = tail call i32 @pthread_exit(i8* null)
ret i8* undef
}
unsigned char bit_field(unsigned char oct, int start, int num) {
  unsigned char mask = (1 << num) - 1;
  return (oct >> start) & mask;
}


x86 assembly (clang, -O0):
<bit_field>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
sub    $0x1,%eax
mov    %al,-0xd(%rbp)
movzbl -0x1(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_field>:
mov    %edx,%ecx
mov    $0xffffffff,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
not    %eax
and    %edi,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @bit_field(i8 zeroext %0, i32 %1, i32 %2) {
%4 = shl nsw i32 -1, %2
%5 = zext i8 %0 to i32
%6 = lshr i32 %5, %1
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = trunc i32 %8 to i8
ret i8 %9
}
/* Type definitions */
struct yaffs_dev {
  int dummy;
};

/* Variables and functions */
int yaffs_unmount2_common(struct yaffs_dev *, int /*<<< orphan*/, int);
int yaffs_unmount2_reldev(struct yaffs_dev *dev, int force) {
  return yaffs_unmount2_common(dev, (0), force);
}


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

x86 assembly (clang, -O2):
<yaffs_unmount2_reldev>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <yaffs_unmount2_common@plt>

LLVM IR (-O0):
%struct.yaffs_dev = type { i32 }
define i32 @yaffs_unmount2_reldev(%struct.yaffs_dev* %0, i32 %1) {
%3 = alloca %struct.yaffs_dev*
%4 = alloca i32
store %struct.yaffs_dev* %0, %struct.yaffs_dev** %3
store i32 %1, i32* %4
%5 = load %struct.yaffs_dev*, %struct.yaffs_dev** %3
%6 = load i32, i32* %4
%7 = call i32 @yaffs_unmount2_common(%struct.yaffs_dev* %5, i32 0, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.yaffs_dev = type { i32 }
define i32 @yaffs_unmount2_reldev(%struct.yaffs_dev* %0, i32 %1) {
%3 = tail call i32 @yaffs_unmount2_common(%struct.yaffs_dev* %0, i32 0, i32 %1)
ret i32 %3
}
/* Variables and functions */
long strtol(char const *, char **, unsigned int);
long asc2long(const char *s, unsigned base, int ignore_errors) {
  char *endp;
  long rc = strtol(s, &endp, base);
  if (*endp && !ignore_errors) {
    return -1;
  }
  return rc;
}


x86 assembly (clang, -O0):
<asc2long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
lea    -0x20(%rbp),%rsi
call   1030 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <asc2long+0x4d>
cmpl   $0x0,-0x18(%rbp)
jne    115d <asc2long+0x4d>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1165 <asc2long+0x55>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asc2long>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %esi,%edx
lea    0x8(%rsp),%rsi
call   1030 <strtol@plt>
mov    0x8(%rsp),%rcx
xor    %edx,%edx
cmp    (%rcx),%dl
sbb    %rcx,%rcx
or     %rax,%rcx
test   %ebx,%ebx
cmove  %rcx,%rax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @asc2long(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i64 @strtol(i8* %0, i8** %4, i32 %1)
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 0
%10 = icmp ne i32 %2, 0
%11 = or i1 %10, %9
%12 = select i1 %11, i64 %6, i64 -1
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ sendBlink(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sendConf(int, int);
void setDisabled(int sockfd) {
  sendConf(sockfd, (1 << 7) | (3 << 3) | (2 << 1));
  sendBlink(sockfd, 0x13, 0, 0);
}


x86 assembly (clang, -O0):
<setDisabled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x9c,%esi
call   1040 <sendConf@plt>
mov    -0x4(%rbp),%edi
mov    $0x13,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <sendBlink@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDisabled>:
push   %rbx
mov    %edi,%ebx
mov    $0x9c,%esi
call   1040 <sendConf@plt>
mov    %ebx,%edi
mov    $0x13,%esi
xor    %edx,%edx
xor    %ecx,%ecx
pop    %rbx
jmp    1030 <sendBlink@plt>

LLVM IR (-O0):
define void @setDisabled(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @sendConf(i32 %3, i32 156)
%5 = load i32, i32* %2
%6 = call i32 @sendBlink(i32 %5, i32 19, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @setDisabled(i32 %0) {
%2 = tail call i32 @sendConf(i32 %0, i32 156)
%3 = tail call i32 @sendBlink(i32 %0, i32 19, i32 0, i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void fail(char *s) {
  printf("%s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @fail(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
struct rlimit {
  int rlim_cur;
  int rlim_max;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_STACK;
int /*<<< orphan*/ abort();
int /*<<< orphan*/ down(int);
scalar_t__ setrlimit(int /*<<< orphan*/, struct rlimit *);
int main(void) {
  struct rlimit r;
  r.rlim_cur = 8192 * 1024;
  r.rlim_max = 8192 * 1024;
  if (setrlimit(RLIMIT_STACK, &r) != 0)
    abort();
  down(1000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x800000,-0x10(%rbp)
movl   $0x800000,-0xc(%rbp)
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   1050 <setrlimit@plt>
cmp    $0x0,%rax
je     1170 <main+0x40>
mov    $0x0,%al
call   1030 <abort@plt>
mov    $0x3e8,%edi
call   1040 <down@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movabs $0x80000000800000,%rax
mov    %rax,(%rsp)
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1050 <setrlimit@plt>
test   %rax,%rax
jne    1163 <main+0x33>
mov    $0x3e8,%edi
call   1040 <down@plt>
xor    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.rlimit = type { i32, i32 }
@RLIMIT_STACK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rlimit
store i32 0, i32* %1
%3 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 0
store i32 8388608, i32* %3
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 1
store i32 8388608, i32* %4
%5 = load i32, i32* @RLIMIT_STACK
%6 = call i64 @setrlimit(i32 %5, %struct.rlimit* %2)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = call i32 @down(i32 1000)
ret i32 0
}

LLVM IR (-O2):
%struct.rlimit = type { i32, i32 }
@RLIMIT_STACK = global i32 0
define i32 @main() {
%1 = alloca %struct.rlimit
%2 = bitcast %struct.rlimit* %1 to i8*
%3 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
store i32 8388608, i32* %3
%4 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 1
store i32 8388608, i32* %4
%5 = load i32, i32* @RLIMIT_STACK
%6 = call i64 @setrlimit(i32 %5, %struct.rlimit* %1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %0
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %0
%11 = call i32 @down(i32 1000)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ xdr_u_int(int /*<<< orphan*/ *, unsigned int *);
bool_t xdr_u_char(XDR *xdrs, unsigned char *cp) {
  unsigned int u;
  u = (*cp);
  if (!xdr_u_int(xdrs, &u)) {
    return (FALSE);
  }
  *cp = u;
  return (TRUE);
}


x86 assembly (clang, -O0):
<xdr_u_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <xdr_u_int@plt>
cmp    $0x0,%eax
jne    1151 <xdr_u_char+0x41>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <xdr_u_char+0x58>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_u_char>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movzbl (%rsi),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <xdr_u_int@plt>
test   %eax,%eax
je     113c <xdr_u_char+0x2c>
mov    0xc(%rsp),%al
mov    %al,(%rbx)
mov    0x2eae(%rip),%rax
jmp    1143 <xdr_u_char+0x33>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_u_char(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
store i32 %9, i32* %6
%10 = load i32*, i32** %4
%11 = call i32 @xdr_u_int(i32* %10, i32* %6)
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = load i32, i32* @FALSE
store i32 %14, i32* %3
br label %20
15: ; preds = %2
%16 = load i32, i32* %6
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %5
store i8 %17, i8* %18
%19 = load i32, i32* @TRUE
store i32 %19, i32* %3
br label %20
20: ; preds = %15, %13
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_u_char(i32* %0, i8* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i8, i8* %1
%6 = zext i8 %5 to i32
store i32 %6, i32* %3
%7 = call i32 @xdr_u_int(i32* %0, i32* %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %3
%11 = trunc i32 %10 to i8
store i8 %11, i8* %1
br label %12
12: ; preds = %2, %9
%13 = phi i32* [ @TRUE, %9 ], [ @FALSE, %2 ]
%14 = load i32, i32* %13
ret i32 %14
}
void foo795(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo795(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ objtopie();
int /*<<< orphan*/ parse_args(int, char **);
int main(int argc, char *argv[]) {
  parse_args(argc, argv);
  objtopie();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <parse_args@plt>
mov    $0x0,%al
call   1040 <objtopie@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 @parse_args(i32 %6, i8** %7)
%9 = call i32 (...) @objtopie()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @parse_args(i32 %0, i8** %1)
%4 = tail call i32 (...) @objtopie()
ret i32 0
}