xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ err_sys(char *);
void *malloc(size_t);
void *vn_alloc(size_t size) {
  void *p;
  p = malloc(size);
  if (NULL == p) {
    err_sys("vn_alloc malloc error");
  }
  return p;
}


x86 assembly (clang, -O0):
<vn_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    1151 <vn_alloc+0x31>
lea    0xeb4(%rip),%rdi
call   1030 <err_sys@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vn_alloc>:
push   %rbx
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <vn_alloc+0x1a>
lea    0xecb(%rip),%rdi
call   1030 <err_sys@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"vn_alloc malloc error\00"
define i8* @vn_alloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* null, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @err_sys(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [22 x i8] c"vn_alloc malloc error\00"
define noalias i8* @vn_alloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @err_sys(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
int main(int argc, char **argv) {
  int arg;
  int ar;
  arg = argc;
  ar = argc * 2;
  return arg + ar;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
lea    (%rdi,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = mul nsw i32 %0, 3
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("sfs");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"sfs\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int qtd_num(int num) {
  int contador;
  if (num != 0) {
    if (num < 0) {
      num = num * (-1);
    }
    for (contador = 0; num > 0; contador++) {
      num = num / 10;
    }
    return contador;
  } else {
    return 1;
  }
}


x86 assembly (clang, -O0):
<qtd_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     115a <qtd_num+0x5a>
cmpl   $0x0,-0x8(%rbp)
jge    1122 <qtd_num+0x22>
imul   $0xffffffff,-0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114f <qtd_num+0x4f>
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <qtd_num+0x29>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1161 <qtd_num+0x61>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qtd_num>:
test   %edi,%edi
je     1135 <qtd_num+0x35>
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
xor    %eax,%eax
mov    $0xcccccccd,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
add    $0x1,%eax
cmp    $0x9,%ecx
mov    %esi,%ecx
ja     1120 <qtd_num+0x20>
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @qtd_num(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %25
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %7
%11 = load i32, i32* %3
%12 = mul nsw i32 %11, -1
store i32 %12, i32* %3
br label %13
13: ; preds = %10, %7
store i32 0, i32* %4
br label %14
14: ; preds = %20, %13
%15 = load i32, i32* %3
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %14
%18 = load i32, i32* %3
%19 = sdiv i32 %18, 10
store i32 %19, i32* %3
br label %20
20: ; preds = %17
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %14
23: ; preds = %14
%24 = load i32, i32* %4
store i32 %24, i32* %2
br label %26
25: ; preds = %1
store i32 1, i32* %2
br label %26
26: ; preds = %25, %23
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
define i32 @qtd_num(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
br label %5
5: ; preds = %3, %5
%6 = phi i32 [ %9, %5 ], [ 0, %3 ]
%7 = phi i32 [ %8, %5 ], [ %4, %3 ]
%8 = udiv i32 %7, 10
%9 = add nuw nsw i32 %6, 1
%10 = icmp ult i32 %7, 10
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i32 [ 1, %1 ], [ %9, %5 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ ClearBitMask(int, int);
void AntennaOff(void) { ClearBitMask(0x14, 0x03); }


x86 assembly (clang, -O0):
<AntennaOff>:
push   %rbp
mov    %rsp,%rbp
mov    $0x14,%edi
mov    $0x3,%esi
call   1030 <ClearBitMask@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<AntennaOff>:
mov    $0x14,%edi
mov    $0x3,%esi
jmp    1030 <ClearBitMask@plt>

LLVM IR (-O0):
define void @AntennaOff() {
%1 = call i32 @ClearBitMask(i32 20, i32 3)
ret void
}

LLVM IR (-O2):
define void @AntennaOff() {
%1 = tail call i32 @ClearBitMask(i32 20, i32 3)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ writel(int /*<<< orphan*/, void *);
void write_pxpat1(unsigned port, uint32_t value) {
  writel(value, (void *)0xb0010000 + (port * 0x100) + (0x30));
}


x86 assembly (clang, -O0):
<write_pxpat1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
mov    %eax,%eax
mov    $0xb0010000,%esi
add    %rax,%rsi
add    $0x30,%rsi
call   1030 <writel@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pxpat1>:
mov    %esi,%eax
shl    $0x8,%edi
mov    $0xb0010030,%esi
add    %rdi,%rsi
mov    %eax,%edi
jmp    1030 <writel@plt>

LLVM IR (-O0):
define void @write_pxpat1(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 = load i32, i32* %3
%7 = mul i32 %6, 256
%8 = zext i32 %7 to i64
%9 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %8
%10 = getelementptr i8, i8* %9, i64 48
%11 = call i32 @writel(i32 %5, i8* %10)
ret void
}

LLVM IR (-O2):
define void @write_pxpat1(i32 %0, i32 %1) {
%3 = shl i32 %0, 8
%4 = zext i32 %3 to i64
%5 = getelementptr i8, i8* inttoptr (i64 2952855552 to i8*), i64 %4
%6 = getelementptr i8, i8* %5, i64 48
%7 = tail call i32 @writel(i32 %1, i8* %6)
ret void
}
void __msm_gpio_set_subsys_id(unsigned id) { return; }


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

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

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

LLVM IR (-O2):
define void @__msm_gpio_set_subsys_id(i32 %0) {
ret void
}
unsigned xrop3_207_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = ~T;
  stk1 = S | stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_207_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_207_1_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
or     %ecx,%eax
not    %eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_207_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = shl i32 %11, 8
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = or i32 %12, %14
store i32 %15, i32* %6
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = shl i32 %17, 8
%19 = load i8, i8* %4
%20 = zext i8 %19 to i32
%21 = or i32 %18, %20
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = xor i32 %22, -1
store i32 %23, i32* %9
%24 = load i32, i32* %6
%25 = load i32, i32* %9
%26 = or i32 %24, %25
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = load i32, i32* %6
%29 = xor i32 %28, -1
%30 = and i32 %27, %29
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = and i32 %31, %32
%34 = or i32 %30, %33
ret i32 %34
}

LLVM IR (-O2):
define i32 @xrop3_207_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = or i32 %8, %3
ret i32 %9
}
int my_cap(void *str) {
  if (*(char *)str >= 'a' && *(char *)str <= 'z')
    *(char *)str -= 32;
  return (0);
}


x86 assembly (clang, -O0):
<my_cap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1134 <my_cap+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1134 <my_cap+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_cap>:
mov    (%rdi),%al
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     110e <my_cap+0xe>
add    $0xe0,%al
mov    %al,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_cap(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -97
%4 = icmp ult i8 %3, 26
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i8 %2, -32
store i8 %6, i8* %0
br label %7
7: ; preds = %5, %1
ret i32 0
}
/* Variables and functions */
size_t my_strlen(const char *str) {
  size_t len = 0;
  while (str[len]) {
    len++;
  }
  return len;
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1133 <my_strlen+0x33>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <my_strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @my_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
void foo371(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo371(i32 %0) {
ret void
}
/* Variables and functions */
int strlen(char const *);
int /*<<< orphan*/ uart_putc(char const);
void uart_puts(const char *str) {
  int len = strlen(str);
  for (short i = 0; i < len; i++) {
    uart_putc(str[i]);
  }
}


x86 assembly (clang, -O0):
<uart_puts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0xc(%rbp)
movw   $0x0,-0xe(%rbp)
movswl -0xe(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116e <uart_puts+0x4e>
mov    -0x8(%rbp),%rax
movswq -0xe(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <uart_putc@plt>
mov    -0xe(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0xe(%rbp)
jmp    113e <uart_puts+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_puts>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1158 <uart_puts+0x38>
mov    %eax,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movswq %bx,%rax
movsbl (%r14,%rax,1),%edi
call   1030 <uart_putc@plt>
add    $0x1,%ebx
movswl %bx,%eax
cmp    %eax,%ebp
jg     1140 <uart_puts+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @uart_puts(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %1
ret void
5: ; preds = %1, %5
%6 = phi i16 [ %11, %5 ], [ 0, %1 ]
%7 = sext i16 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i32 @uart_putc(i8 signext %9)
%11 = add i16 %6, 1
%12 = sext i16 %11 to i32
%13 = icmp sgt i32 %2, %12
br i1 %13, label %5, label %4
}
/* Variables and functions */
int /*<<< orphan*/ clear(char *, size_t);
size_t dlsizeof(void *);
void clear_extra(void *p, size_t n) {
  n = (n + 3) & ~3;
  size_t extra = dlsizeof(p) - n;
  if (extra)
    clear((char *)p + n, extra);
}


x86 assembly (clang, -O0):
<clear_extra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x3,%rax
and    $0xfffffffffffffffc,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <dlsizeof@plt>
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     116d <clear_extra+0x4d>
mov    -0x8(%rbp),%rdi
add    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <clear@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_extra>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x3,%rbx
and    $0xfffffffffffffffc,%rbx
call   1030 <dlsizeof@plt>
sub    %rbx,%rax
je     1151 <clear_extra+0x31>
add    %rbx,%r14
mov    %r14,%rdi
mov    %rax,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <clear@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @clear_extra(i8* %0, i64 %1) {
%3 = add i64 %1, 3
%4 = and i64 %3, -4
%5 = tail call i64 @dlsizeof(i8* %0)
%6 = sub i64 %5, %4
%7 = icmp eq i64 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = getelementptr inbounds i8, i8* %0, i64 %4
%10 = tail call i32 @clear(i8* %9, i64 %6)
br label %11
11: ; preds = %8, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ liballoc_memset(void *, int /*<<< orphan*/, int);
void *malloc(int);
void *calloc(size_t nobj, size_t size) {
  int real_size;
  void *p;
  real_size = nobj * size;
  p = malloc(real_size);
  liballoc_memset(p, 0, real_size);
  return p;
}


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
xor    %esi,%esi
call   1030 <liballoc_memset@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
imul   %edi,%ebx
mov    %ebx,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    %ebx,%edx
call   1030 <liballoc_memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%7 = load i64, i64* %3
%8 = load i64, i64* %4
%9 = mul i64 %7, %8
%10 = trunc i64 %9 to i32
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = call i8* @malloc(i32 %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = load i32, i32* %5
%15 = call i32 @liballoc_memset(i8* %13, i32 0, i32 %14)
%16 = load i8*, i8** %6
ret i8* %16
}

LLVM IR (-O2):
define i8* @calloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = trunc i64 %3 to i32
%5 = tail call i8* @malloc(i32 %4)
%6 = tail call i32 @liballoc_memset(i8* %5, i32 0, i32 %4)
ret i8* %5
}
void DPMSSetTimeouts() {}


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

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

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

LLVM IR (-O2):
define void @DPMSSetTimeouts() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SpinYetAgain();
void SpinSomeMore() {
  volatile unsigned int count = 0;
  int i;
  for (i = 0; i < 1000; i++) {
    count++;
  }
  SpinYetAgain();
}


x86 assembly (clang, -O0):
<SpinSomeMore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x3e8,-0x8(%rbp)
jge    114a <SpinSomeMore+0x3a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <SpinSomeMore+0x16>
mov    $0x0,%al
call   1030 <SpinYetAgain@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SpinSomeMore>:
movl   $0x0,-0x4(%rsp)
mov    $0x3e8,%eax
nopl   (%rax)
addl   $0x1,-0x4(%rsp)
addl   $0x1,-0x4(%rsp)
addl   $0x1,-0x4(%rsp)
addl   $0x1,-0x4(%rsp)
addl   $0x1,-0x4(%rsp)
add    $0xfffffffb,%eax
jne    1120 <SpinSomeMore+0x10>
xor    %eax,%eax
jmp    1030 <SpinYetAgain@plt>

LLVM IR (-O0):
define void @SpinSomeMore() {
%1 = alloca i32
%2 = alloca i32
store volatile i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 1000
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load volatile i32, i32* %1
%8 = add i32 %7, 1
store volatile i32 %8, i32* %1
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = call i32 (...) @SpinYetAgain()
ret void
}

LLVM IR (-O2):
define void @SpinSomeMore() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store volatile i32 0, i32* %1
br label %3
3: ; preds = %3, %0
%4 = phi i32 [ 0, %0 ], [ %15, %3 ]
%5 = load volatile i32, i32* %1
%6 = add i32 %5, 1
store volatile i32 %6, i32* %1
%7 = load volatile i32, i32* %1
%8 = add i32 %7, 1
store volatile i32 %8, i32* %1
%9 = load volatile i32, i32* %1
%10 = add i32 %9, 1
store volatile i32 %10, i32* %1
%11 = load volatile i32, i32* %1
%12 = add i32 %11, 1
store volatile i32 %12, i32* %1
%13 = load volatile i32, i32* %1
%14 = add i32 %13, 1
store volatile i32 %14, i32* %1
%15 = add nuw nsw i32 %4, 5
%16 = icmp eq i32 %15, 1000
br i1 %16, label %17, label %3
17: ; preds = %3
%18 = tail call i32 (...) @SpinYetAgain()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ w5100_readSHAR(int /*<<< orphan*/ *);
void w5100_getMACAddress(uint8_t *addr) { w5100_readSHAR(addr); }


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

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

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

LLVM IR (-O2):
define void @w5100_getMACAddress(i32* %0) {
%2 = tail call i32 @w5100_readSHAR(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ grid_ins_term();
void grid_inproc_term(void) { grid_ins_term(); }


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

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

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

LLVM IR (-O2):
define void @grid_inproc_term() {
%1 = tail call i32 (...) @grid_ins_term()
ret void
}
void ff_hevc_put_hevc_uni_epel_v32_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_epel_v32_8_sse4() {
ret void
}
double H(const double et) {
  double jd = (et / 86400.0) - 0.5;
  double dfrac = jd - (long)jd;
  double hh = dfrac * 24.0;
  if (hh < 0.0)
    hh += 24.0;
  return hh;
}


x86 assembly (clang, -O0):
<H>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xefa(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvttsd2si -0x10(%rbp),%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xeb4(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x20(%rbp),%xmm0
jbe    1176 <H+0x76>
movsd  0xe94(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<H>:
divsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%rax
cvtsi2sd %rax,%xmm1
subsd  %xmm1,%xmm0
movsd  0xeea(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm0,%xmm2
xorpd  %xmm3,%xmm3
movapd %xmm0,%xmm1
cmpltsd %xmm3,%xmm1
andpd  %xmm1,%xmm2
andnpd %xmm0,%xmm1
orpd   %xmm2,%xmm1
movapd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @H(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %2
%6 = load double, double* %2
%7 = fdiv double %6, 8.640000e+04
%8 = fsub double %7, 5.000000e-01
store double %8, double* %3
%9 = load double, double* %3
%10 = load double, double* %3
%11 = fptosi double %10 to i64
%12 = sitofp i64 %11 to double
%13 = fsub double %9, %12
store double %13, double* %4
%14 = load double, double* %4
%15 = fmul double %14, 2.400000e+01
store double %15, double* %5
%16 = load double, double* %5
%17 = fcmp olt double %16, 0.000000e+00
br i1 %17, label %18, label %21
18: ; preds = %1
%19 = load double, double* %5
%20 = fadd double %19, 2.400000e+01
store double %20, double* %5
br label %21
21: ; preds = %18, %1
%22 = load double, double* %5
ret double %22
}

LLVM IR (-O2):
define double @H(double %0) {
%2 = fdiv double %0, 8.640000e+04
%3 = fadd double %2, -5.000000e-01
%4 = fptosi double %3 to i64
%5 = sitofp i64 %4 to double
%6 = fsub double %3, %5
%7 = fmul double %6, 2.400000e+01
%8 = fcmp olt double %7, 0.000000e+00
%9 = fadd double %7, 2.400000e+01
%10 = select i1 %8, double %9, double %7
ret double %10
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint64_t;
typedef scalar_t__ uint32_t;
typedef scalar_t__ l;
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t uint8_comparator(const void *l, const void *r) {
  return (uint8_t)(uint32_t)(uint64_t)(l) - (uint8_t)(uint32_t)(uint64_t)(r);
}


x86 assembly (clang, -O0):
<uint8_comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uint8_comparator>:
mov    %rdi,%rax
sub    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @uint8_comparator(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 = ptrtoint i8* %5 to i64
%7 = load i8*, i8** %4
%8 = ptrtoint i8* %7 to i64
%9 = sub nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @uint8_comparator(i8* %0, i8* %1) {
%3 = ptrtoint i8* %0 to i64
%4 = ptrtoint i8* %1 to i64
%5 = sub nsw i64 %3, %4
ret i64 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int EINVAL;
__attribute__((visibility("default"))) int
sd_uid_get_sessions(uid_t uid, int require_active, char ***sessions) {
  return -EINVAL;
}


x86 assembly (clang, -O0):
<sd_uid_get_sessions>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ec9(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sd_uid_get_sessions>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i32 @sd_uid_get_sessions(i32 %0, i32 %1, i8*** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8***
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8*** %2, i8**** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @sd_uid_get_sessions(i32 %0, i32 %1, i8*** nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
ret i32 %5
}
const char *selectOpName(int id) {
  char *z;
  switch (id) {
  case 108:
    z = "UNION ALL";
    break;
  case 110:
    z = "INTERSECT";
    break;
  case 109:
    z = "EXCEPT";
    break;
  default:
    z = "UNION";
    break;
  }
  return z;
}


x86 assembly (clang, -O0):
<selectOpName>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
sub    $0x6c,%eax
je     113d <selectOpName+0x3d>
jmp    111b <selectOpName+0x1b>
mov    -0x14(%rbp),%eax
sub    $0x6d,%eax
je     115d <selectOpName+0x5d>
jmp    112c <selectOpName+0x2c>
mov    -0x14(%rbp),%eax
sub    $0x6e,%eax
je     114d <selectOpName+0x4d>
jmp    116d <selectOpName+0x6d>
lea    0xebc(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1178 <selectOpName+0x78>
lea    0xeb6(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1178 <selectOpName+0x78>
lea    0xeb0(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1178 <selectOpName+0x78>
lea    0xea7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<selectOpName>:
add    $0xffffff94,%edi
cmp    $0x2,%edi
ja     111a <selectOpName+0x1a>
movslq %edi,%rax
lea    0xf12(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xefa(%rip),%rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"UNION ALL\00"
@.str.1 = [10 x i8] c"INTERSECT\00"
@.str.2 = [7 x i8] c"EXCEPT\00"
@.str.3 = [6 x i8] c"UNION\00"
define i8* @selectOpName(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
switch i32 %4, label %8 [
i32 108, label %5
i32 110, label %6
i32 109, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %3
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8** %3
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %3
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8** %3
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
@.str = [10 x i8] c"UNION ALL\00"
@.str.1 = [10 x i8] c"INTERSECT\00"
@.str.2 = [7 x i8] c"EXCEPT\00"
@.str.3 = [6 x i8] c"UNION\00"
@reltable.selectOpName = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.selectOpName to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.selectOpName to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.selectOpName to i64)) to i32)]
define i8* @selectOpName(i32 %0) {
%2 = add i32 %0, -108
%3 = icmp ult i32 %2, 3
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = shl i64 %5, 2
%7 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.selectOpName to i8*), i64 %6)
br label %8
8: ; preds = %1, %4
%9 = phi i8* [ %7, %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %9
}
int fun835() { return 835; }


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

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

LLVM IR (-O0):
define i32 @fun835() {
ret i32 835
}

LLVM IR (-O2):
define i32 @fun835() {
ret i32 835
}
/* Variables and functions */
int /*<<< orphan*/ assign(int *, int);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
void allocated_pointer_passed_as_argument() {
  int *p = NULL;
  p = (int *)malloc(sizeof(int));
  if (p) {
    assign(p, 42);
    free(p);
  }
}


x86 assembly (clang, -O0):
<allocated_pointer_passed_as_argument>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x0,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1170 <allocated_pointer_passed_as_argument+0x40>
mov    -0x8(%rbp),%rdi
mov    $0x2a,%esi
call   1050 <assign@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocated_pointer_passed_as_argument>:
push   %rbx
mov    $0x4,%edi
call   1040 <malloc@plt>
test   %rax,%rax
je     1159 <allocated_pointer_passed_as_argument+0x29>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2a,%esi
call   1050 <assign@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @allocated_pointer_passed_as_argument() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = call i64 @malloc(i32 4)
%3 = inttoptr i64 %2 to i32*
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = icmp ne i32* %4, null
br i1 %5, label %6, label %11
6: ; preds = %0
%7 = load i32*, i32** %1
%8 = call i32 @assign(i32* %7, i32 42)
%9 = load i32*, i32** %1
%10 = call i32 @free(i32* %9)
br label %11
11: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
define void @allocated_pointer_passed_as_argument() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = tail call i32 @assign(i32* %2, i32 42)
%6 = tail call i32 @free(i32* %2)
br label %7
7: ; preds = %4, %0
ret void
}
int f4(int a) {
  int v1 = (a == 1);
  int v2 = (a == 2);
  return v1 || v2;
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x2,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
jne    113e <f4+0x3e>
cmpl   $0x0,-0xc(%rbp)
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
add    $0xffffffff,%edi
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @f4(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 2
%10 = zext i1 %9 to i32
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %1
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 0
br label %16
16: ; preds = %13, %1
%17 = phi i1 [ true, %1 ], [ %15, %13 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @f4(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ pclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *popen(char *, char *);
int get_cpu_quantity() {
  int cpu_quantity = 0;
  FILE *file = popen("cat /proc/cpuinfo | grep -c processor", "r");
  fscanf(file, "%d", &cpu_quantity);
  pclose(file);
  return cpu_quantity;
}


x86 assembly (clang, -O0):
<get_cpu_quantity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
lea    -0x4(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <pclose@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_cpu_quantity>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xebc(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1050 <popen@plt>
mov    %rax,%rbx
lea    0xecc(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <pclose@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"cat /proc/cpuinfo | grep -c processor\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @get_cpu_quantity() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @popen(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32*, i32** %2
%7 = call i32 @pclose(i32* %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [38 x i8] c"cat /proc/cpuinfo | grep -c processor\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @get_cpu_quantity() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32* @popen(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = call i32 @pclose(i32* %3)
%6 = load i32, i32* %1
ret i32 %6
}
int xstrcmp(p1, p2)
char *p1, *p2;
{ return (strcmp(*(char **)p1, *(char **)p2)); }


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

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

LLVM IR (-O0):
define i32 @xstrcmp(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @xstrcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ __menuet__delay100(int);
int pause(void) {
  __menuet__delay100(1);
  return 0;
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <__menuet__delay100@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
mov    $0x1,%edi
call   1030 <__menuet__delay100@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @pause() {
%1 = tail call i32 @__menuet__delay100(i32 1)
ret i32 0
}
int test_imm_16int8_mem(signed char *val) {
  return ((*val) & (0x16 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_16int8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, 22
%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_16int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 22
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int gru_unit_kb(int);
uint64_t gru_unit_mb(uint64_t num) { return gru_unit_kb(num) / 1024; }


x86 assembly (clang, -O0):
<gru_unit_mb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <gru_unit_kb@plt>
mov    $0x400,%ecx
cltd
idiv   %ecx
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gru_unit_mb>:
push   %rax
call   1030 <gru_unit_kb@plt>
lea    0x3ff(%rax),%ecx
test   %eax,%eax
cmovs  %ecx,%eax
sar    $0xa,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @gru_unit_mb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @gru_unit_kb(i32 %3)
%5 = sdiv i32 %4, 1024
ret i32 %5
}

LLVM IR (-O2):
define i32 @gru_unit_mb(i32 %0) {
%2 = tail call i32 @gru_unit_kb(i32 %0)
%3 = sdiv i32 %2, 1024
ret i32 %3
}
float F(float a) { return -a; }


x86 assembly (clang, -O0):
<F>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<F>:
xorps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @F(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fneg float %3
ret float %4
}

LLVM IR (-O2):
define float @F(float %0) {
%2 = fneg float %0
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ _PC_NAME_MAX;
int pathconf(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int filenameLength() {
  int result;
  if ((result = pathconf("/", _PC_NAME_MAX)) != -1) {
    printf("_PC_NAME_MAX is %d\n", result);
    return result;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<filenameLength>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <pathconf@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
je     1163 <filenameLength+0x43>
mov    -0x8(%rbp),%esi
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116a <filenameLength+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filenameLength>:
push   %rbx
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <pathconf@plt>
cmp    $0xffffffff,%eax
je     114d <filenameLength+0x2d>
mov    %eax,%ebx
lea    0xebe(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
jmp    114f <filenameLength+0x2f>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"/\00"
@_PC_NAME_MAX = global i32 0
@.str.1 = [20 x i8] c"_PC_NAME_MAX is %d\0A\00"
define i32 @filenameLength() {
%1 = load i32, i32* @_PC_NAME_MAX
%2 = tail call i32 @pathconf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %6, label %4
4: ; preds = %0
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %2)
br label %6
6: ; preds = %0, %4
%7 = phi i32 [ %2, %4 ], [ 0, %0 ]
ret i32 %7
}
void I2SRxFIFOLimitSet(unsigned long ulBase, unsigned long ulLevel) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x0000080C))) = ulLevel;
}


x86 assembly (clang, -O0):
<I2SRxFIFOLimitSet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x80c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2SRxFIFOLimitSet>:
mov    %rsi,0x80c(%rdi)
ret

LLVM IR (-O0):
define void @I2SRxFIFOLimitSet(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 2060
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @I2SRxFIFOLimitSet(i64 %0, i64 %1) {
%3 = add i64 %0, 2060
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
double modf(double, double *);
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  double x = 4.414;
  double iPart;
  double fPart = modf(x, &iPart);
  printf("x的整数部分是：%f，小数部分是：%.3f\n", iPart, fPart);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  0xed0(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
call   1040 <modf@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeaf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xed7(%rip),%xmm0
mov    %rsp,%rdi
call   1040 <modf@plt>
movaps %xmm0,%xmm1
movsd  (%rsp),%xmm0
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [51 x i8] c"x\E7\9A\84\E6\95\B4\E6\95\B0\E9\83\A8\E5\88\86\E6\98\AF\EF\BC\9A%f\EF\BC\8C\E5\B0\8F\E6\95\B0\E9\83\A8\E5\88\86\E6\98\AF\EF\BC\9A%.3f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
store double 4.414000e+00, double* %1
%4 = load double, double* %1
%5 = call double @modf(double %4, double* %2)
store double %5, double* %3
%6 = load double, double* %2
%7 = load double, double* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), double %6, double %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [51 x i8] c"x\E7\9A\84\E6\95\B4\E6\95\B0\E9\83\A8\E5\88\86\E6\98\AF\EF\BC\9A%f\EF\BC\8C\E5\B0\8F\E6\95\B0\E9\83\A8\E5\88\86\E6\98\AF\EF\BC\9A%.3f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call double @modf(double 4.414000e+00, double* %1)
%4 = load double, double* %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), double %4, double %3)
ret i32 0
}
void SplitRGBRow_SSSE3() {}


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

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

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

LLVM IR (-O2):
define void @SplitRGBRow_SSSE3() {
ret void
}
void ble_rsp_dfu_reset(const void *nul) {}


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

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

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

LLVM IR (-O2):
define void @ble_rsp_dfu_reset(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ insert(int);
int /*<<< orphan*/ print();
int main() {
  insert(2);
  insert(3);
  print();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1040 <insert@plt>
mov    $0x3,%edi
call   1040 <insert@plt>
xor    %eax,%eax
call   1030 <print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @insert(i32 2)
%3 = call i32 @insert(i32 3)
%4 = call i32 (...) @print()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @insert(i32 2)
%2 = tail call i32 @insert(i32 3)
%3 = tail call i32 (...) @print()
ret i32 0
}