xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ SetBrushColor86(unsigned long);
void setbrushcolor(unsigned long c) { SetBrushColor86(c); }


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

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

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

LLVM IR (-O2):
define void @setbrushcolor(i64 %0) {
%2 = tail call i32 @SetBrushColor86(i64 %0)
ret void
}
void foo370() {}


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

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

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

LLVM IR (-O2):
define void @foo370() {
ret void
}
int isSorted(int array[], int n) {
  for (int i = 1; i < n; i++) {
    if (array[i] < array[i - 1])
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isSorted>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    115e <isSorted+0x5e>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jge    114b <isSorted+0x4b>
movl   $0x0,-0x4(%rbp)
jmp    1165 <isSorted+0x65>
jmp    1150 <isSorted+0x50>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <isSorted+0x12>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSorted>:
mov    $0x1,%eax
cmp    $0x2,%esi
jl     113d <isSorted+0x3d>
mov    0x4(%rdi),%edx
xor    %eax,%eax
cmp    (%rdi),%edx
jl     113d <isSorted+0x3d>
mov    %esi,%r8d
mov    $0x2,%eax
nopl   0x0(%rax,%rax,1)
mov    %rax,%rsi
cmp    %rax,%r8
je     1135 <isSorted+0x35>
mov    (%rdi,%rsi,4),%ecx
lea    0x1(%rsi),%rax
cmp    %edx,%ecx
mov    %ecx,%edx
jge    1120 <isSorted+0x20>
xor    %eax,%eax
cmp    %r8,%rsi
setae  %al
ret

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

LLVM IR (-O2):
define i32 @isSorted(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %23
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = zext i32 %1 to i64
%7 = load i32, i32* %0
%8 = getelementptr inbounds i32, i32* %0, i64 1
%9 = load i32, i32* %8
%10 = icmp slt i32 %9, %7
br i1 %10, label %23, label %11
11: ; preds = %4, %15
%12 = phi i64 [ %19, %15 ], [ 2, %4 ]
%13 = phi i32 [ %17, %15 ], [ %9, %4 ]
%14 = icmp eq i64 %12, %6
br i1 %14, label %20, label %15
15: ; preds = %11
%16 = getelementptr inbounds i32, i32* %0, i64 %12
%17 = load i32, i32* %16
%18 = icmp slt i32 %17, %13
%19 = add nuw nsw i64 %12, 1
br i1 %18, label %20, label %11
20: ; preds = %11, %15
%21 = icmp uge i64 %12, %5
%22 = zext i1 %21 to i32
br label %23
23: ; preds = %20, %4, %2
%24 = phi i32 [ 1, %2 ], [ 0, %4 ], [ %22, %20 ]
ret i32 %24
}
unsigned int peek32(unsigned int addr) {
  return *((volatile unsigned int *)addr);
}


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

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

LLVM IR (-O0):
define i32 @peek32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @peek32(i32 %0) {
%2 = zext i32 %0 to i64
%3 = inttoptr i64 %2 to i32*
%4 = load volatile i32, i32* %3
ret i32 %4
}
unsigned int mod_rhs(int rhs) {
  if (rhs == 0)
    return 1;
  return rhs;
}


x86 assembly (clang, -O0):
<mod_rhs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <mod_rhs+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1123 <mod_rhs+0x23>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod_rhs>:
test   %edi,%edi
mov    $0x1,%eax
cmovne %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @mod_rhs(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
int /*<<< orphan*/ permute(int *, int, int *);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int **ret, n;
  int x[] = {1, 2, 3};
  permute(x, sizeof(x) / sizeof(x[0]), &n);
  printf("%d\n", n);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec8(%rip),%eax
mov    %eax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x3,%esi
lea    -0x14(%rbp),%rdx
call   1030 <permute@plt>
mov    -0x14(%rbp),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xede(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xecb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
lea    0x4(%rsp),%rdx
mov    $0x3,%esi
call   1030 <permute@plt>
mov    0x4(%rsp),%esi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

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

/* Variables and functions */
ptrdiff_t get_pix_ofs(unsigned int x, unsigned int y,
                      struct fb_var_screeninfo const *info) {
  return ((y * info->xres_virtual) + x) * info->bits_per_pixel / 8;
}


x86 assembly (clang, -O0):
<get_pix_ofs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
imul   (%rcx),%eax
add    -0x4(%rbp),%eax
mov    -0x10(%rbp),%rcx
imul   0x4(%rcx),%eax
shr    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pix_ofs>:
imul   (%rdx),%esi
lea    (%rsi,%rdi,1),%eax
imul   0x4(%rdx),%eax
shr    $0x3,%eax
ret

LLVM IR (-O0):
%struct.fb_var_screeninfo = type { i32, i32 }
define i32 @get_pix_ofs(i32 %0, i32 %1, %struct.fb_var_screeninfo* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.fb_var_screeninfo*
store i32 %0, i32* %4
store i32 %1, i32* %5
store %struct.fb_var_screeninfo* %2, %struct.fb_var_screeninfo** %6
%7 = load i32, i32* %5
%8 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%9 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = mul i32 %7, %10
%12 = load i32, i32* %4
%13 = add i32 %11, %12
%14 = load %struct.fb_var_screeninfo*, %struct.fb_var_screeninfo** %6
%15 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %14, i32 0, i32 1
%16 = load i32, i32* %15
%17 = mul i32 %13, %16
%18 = udiv i32 %17, 8
ret i32 %18
}

LLVM IR (-O2):
%struct.fb_var_screeninfo = type { i32, i32 }
define i32 @get_pix_ofs(i32 %0, i32 %1, %struct.fb_var_screeninfo* nocapture %2) {
%4 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %2, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul i32 %5, %1
%7 = add i32 %6, %0
%8 = getelementptr inbounds %struct.fb_var_screeninfo, %struct.fb_var_screeninfo* %2, i64 0, i32 1
%9 = load i32, i32* %8
%10 = mul i32 %7, %9
%11 = lshr i32 %10, 3
ret i32 %11
}
/* Variables and functions */
unsigned short readByte();
unsigned short readShort() {
  unsigned short s;
  s = readByte() << 8;
  s |= readByte();
  return s;
}


x86 assembly (clang, -O0):
<readShort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <readByte@plt>
movzwl %ax,%eax
shl    $0x8,%eax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1030 <readByte@plt>
movzwl %ax,%ecx
movzwl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readShort>:
push   %rbx
xor    %eax,%eax
call   1030 <readByte@plt>
mov    %eax,%ebx
shl    $0x8,%ebx
xor    %eax,%eax
call   1030 <readByte@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i16 @readShort() {
%1 = alloca i16
%2 = call zeroext i16 (...) @readByte()
%3 = zext i16 %2 to i32
%4 = shl i32 %3, 8
%5 = trunc i32 %4 to i16
store i16 %5, i16* %1
%6 = call zeroext i16 (...) @readByte()
%7 = zext i16 %6 to i32
%8 = load i16, i16* %1
%9 = zext i16 %8 to i32
%10 = or i32 %9, %7
%11 = trunc i32 %10 to i16
store i16 %11, i16* %1
%12 = load i16, i16* %1
ret i16 %12
}

LLVM IR (-O2):
define zeroext i16 @readShort() {
%1 = tail call zeroext i16 (...) @readByte()
%2 = shl i16 %1, 8
%3 = tail call zeroext i16 (...) @readByte()
%4 = or i16 %2, %3
ret i16 %4
}
int ReadSign(char *string[]) {
  int sign;
  sign = 1;
  while (((**string) == '+') || ((**string) == '-')) {
    if (**string == '-')
      sign = -sign;
    (*string)++;
  };
  return (sign);
}


x86 assembly (clang, -O0):
<ReadSign>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
mov    $0x1,%al
cmp    $0x2b,%ecx
mov    %al,-0xd(%rbp)
je     113a <ReadSign+0x3a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    114a <ReadSign+0x4a>
jmp    1178 <ReadSign+0x78>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1165 <ReadSign+0x65>
xor    %eax,%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    110f <ReadSign+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadSign>:
mov    (%rdi),%rcx
add    $0x1,%rcx
mov    $0x1,%eax
jmp    1121 <ReadSign+0x21>
xchg   %ax,%ax
mov    %eax,%esi
neg    %esi
cmp    $0x2d,%dl
cmove  %esi,%eax
mov    %rcx,(%rdi)
add    $0x1,%rcx
movzbl -0x1(%rcx),%edx
cmp    $0x2d,%dl
je     1110 <ReadSign+0x10>
cmp    $0x2b,%dl
je     1110 <ReadSign+0x10>
ret

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

LLVM IR (-O2):
define i32 @ReadSign(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %7, %1
%4 = phi i8* [ %2, %1 ], [ %11, %7 ]
%5 = phi i32 [ 1, %1 ], [ %10, %7 ]
%6 = load i8, i8* %4
switch i8 %6, label %12 [
i8 43, label %7
i8 45, label %7
]
7: ; preds = %3, %3
%8 = icmp eq i8 %6, 45
%9 = sub nsw i32 0, %5
%10 = select i1 %8, i32 %9, i32 %5
%11 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %11, i8** %0
br label %3
12: ; preds = %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIGALRM;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
void manejaSenial(sigset_t *set) {
  sigemptyset(set);
  sigaddset(set, SIGALRM);
}


x86 assembly (clang, -O0):
<manejaSenial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <sigemptyset@plt>
mov    -0x8(%rbp),%rdi
mov    0x2ea8(%rip),%rax
mov    (%rax),%esi
call   1040 <sigaddset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<manejaSenial>:
push   %rbx
mov    %rdi,%rbx
call   1030 <sigemptyset@plt>
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <sigaddset@plt>

LLVM IR (-O0):
@SIGALRM = global i32 0
define void @manejaSenial(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @sigemptyset(i32* %3)
%5 = load i32*, i32** %2
%6 = load i32, i32* @SIGALRM
%7 = call i32 @sigaddset(i32* %5, i32 %6)
ret void
}

LLVM IR (-O2):
@SIGALRM = global i32 0
define void @manejaSenial(i32* %0) {
%2 = tail call i32 @sigemptyset(i32* %0)
%3 = load i32, i32* @SIGALRM
%4 = tail call i32 @sigaddset(i32* %0, i32 %3)
ret void
}
/* Variables and functions */
int getpid();
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  int i;
  unsigned char *buff;
  buff = (char *)malloc(sizeof(char) * 1024);
  printf("my pid is %d\n", getpid());
  for (i = 0; i < 60; i++) {
    sleep(60);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x400,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%esi
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x3c,-0x14(%rbp)
jge    11a2 <main+0x62>
mov    $0x3c,%edi
call   1060 <sleep@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1180 <main+0x40>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x400,%edi
call   1050 <malloc@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x3c,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x3c,%edi
call   1060 <sleep@plt>
add    $0xffffffff,%ebx
jne    1170 <main+0x30>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"my pid is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i64 @malloc(i32 1024)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %7
%10 = call i32 (...) @getpid()
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %10)
store i32 0, i32* %6
br label %12
12: ; preds = %17, %2
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 60
br i1 %14, label %15, label %20
15: ; preds = %12
%16 = call i32 @sleep(i32 60)
br label %17
17: ; preds = %15
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %12
20: ; preds = %12
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"my pid is %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @malloc(i32 1024)
%4 = tail call i32 (...) @getpid()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %2, %6
%7 = phi i32 [ 0, %2 ], [ %9, %6 ]
%8 = tail call i32 @sleep(i32 60)
%9 = add nuw nsw i32 %7, 1
%10 = icmp eq i32 %9, 60
br i1 %10, label %11, label %6
11: ; preds = %6
ret i32 0
}
unsigned int rightChild(const unsigned int i) { return (2 * i + 2); }


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

x86 assembly (clang, -O2):
<rightChild>:
lea    (%rdi,%rdi,1),%eax
add    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @rightChild(i32 %0) {
%2 = shl i32 %0, 1
%3 = add i32 %2, 2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __listen(int fd, int n) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__listen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__listen>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__listen(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__listen(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
/* Variables and functions */
int round_int(double);
int timlib_round_int(double d) { return round_int(d); }


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

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

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

LLVM IR (-O2):
define i32 @timlib_round_int(double %0) {
%2 = tail call i32 @round_int(double %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ immed();
int /*<<< orphan*/ outbyte(char);
int /*<<< orphan*/ queuelabel(int);
void immedlit(int lab) {
  immed();
  queuelabel(lab);
  outbyte('+');
}


x86 assembly (clang, -O0):
<immedlit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <immed@plt>
mov    -0x4(%rbp),%edi
call   1040 <queuelabel@plt>
mov    $0x2b,%edi
call   1050 <outbyte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<immedlit>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <immed@plt>
mov    %ebx,%edi
call   1040 <queuelabel@plt>
mov    $0x2b,%edi
pop    %rbx
jmp    1050 <outbyte@plt>

LLVM IR (-O0):
define void @immedlit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @immed()
%4 = load i32, i32* %2
%5 = call i32 @queuelabel(i32 %4)
%6 = call i32 @outbyte(i8 signext 43)
ret void
}

LLVM IR (-O2):
define void @immedlit(i32 %0) {
%2 = tail call i32 (...) @immed()
%3 = tail call i32 @queuelabel(i32 %0)
%4 = tail call i32 @outbyte(i8 signext 43)
ret void
}
double LU_num_flops(int N) {
  double Nd = (double)N;
  return (2.0 * Nd * Nd * Nd / 3.0);
}


x86 assembly (clang, -O0):
<LU_num_flops>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<LU_num_flops>:
cvtsi2sd %edi,%xmm1
movapd %xmm1,%xmm0
addsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
divsd  0xee4(%rip),%xmm0
ret

LLVM IR (-O0):
define double @LU_num_flops(i32 %0) {
%2 = alloca i32
%3 = alloca double
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
store double %5, double* %3
%6 = load double, double* %3
%7 = fmul double 2.000000e+00, %6
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = load double, double* %3
%11 = fmul double %9, %10
%12 = fdiv double %11, 3.000000e+00
ret double %12
}

LLVM IR (-O2):
define double @LU_num_flops(i32 %0) {
%2 = sitofp i32 %0 to double
%3 = fmul double %2, 2.000000e+00
%4 = fmul double %3, %2
%5 = fmul double %4, %2
%6 = fdiv double %5, 3.000000e+00
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ delay(int /*<<< orphan*/);
int /*<<< orphan*/ motorDireito(int);
int /*<<< orphan*/ motorEsquerdo(int);
void girar(char sentido) {
  switch (sentido) {
  case 'E':
    motorDireito(0);
    motorEsquerdo(1);
    delay(0);
    break;
  case 'D':
    motorDireito(1);
    motorEsquerdo(0);
    delay(0);
    break;
  }
}


x86 assembly (clang, -O0):
<girar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x44,%eax
je     1181 <girar+0x51>
jmp    1153 <girar+0x23>
mov    -0x8(%rbp),%eax
sub    $0x45,%eax
jne    1199 <girar+0x69>
jmp    1164 <girar+0x34>
xor    %edi,%edi
call   1040 <motorDireito@plt>
mov    $0x1,%edi
call   1050 <motorEsquerdo@plt>
xor    %edi,%edi
call   1030 <delay@plt>
jmp    1199 <girar+0x69>
mov    $0x1,%edi
call   1040 <motorDireito@plt>
xor    %edi,%edi
call   1050 <motorEsquerdo@plt>
xor    %edi,%edi
call   1030 <delay@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<girar>:
push   %rbx
cmp    $0x45,%edi
je     1144 <girar+0x14>
cmp    $0x44,%edi
jne    115f <girar+0x2f>
xor    %ebx,%ebx
mov    $0x1,%edi
jmp    114b <girar+0x1b>
mov    $0x1,%ebx
xor    %edi,%edi
call   1040 <motorDireito@plt>
mov    %ebx,%edi
call   1050 <motorEsquerdo@plt>
xor    %edi,%edi
pop    %rbx
jmp    1030 <delay@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @girar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %13 [
i32 69, label %5
i32 68, label %9
]
5: ; preds = %1
%6 = call i32 @motorDireito(i32 0)
%7 = call i32 @motorEsquerdo(i32 1)
%8 = call i32 @delay(i32 0)
br label %13
9: ; preds = %1
%10 = call i32 @motorDireito(i32 1)
%11 = call i32 @motorEsquerdo(i32 0)
%12 = call i32 @delay(i32 0)
br label %13
13: ; preds = %1, %9, %5
ret void
}

LLVM IR (-O2):
define void @girar(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %10 [
i32 69, label %4
i32 68, label %3
]
3: ; preds = %1
br label %4
4: ; preds = %1, %3
%5 = phi i32 [ 1, %3 ], [ 0, %1 ]
%6 = phi i32 [ 0, %3 ], [ 1, %1 ]
%7 = tail call i32 @motorDireito(i32 %5)
%8 = tail call i32 @motorEsquerdo(i32 %6)
%9 = tail call i32 @delay(i32 0)
br label %10
10: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  printf("%d", 10 < 20         ? 10
               : 20 < 100 < 25 ? 100
               : 25            ? 10 < 20 ? 10 : 20
               : 100 < 25      ? 100
                               : 25);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ntohl(int /*<<< orphan*/);
uint32_t _dns_parse_uint32(char **p) {
  uint32_t *x, v;
  x = (uint32_t *)*p;
  v = ntohl(*x);
  *p += 4;
  return v;
}


x86 assembly (clang, -O0):
<_dns_parse_uint32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohl@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_dns_parse_uint32>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    (%rbx),%edi
call   1030 <ntohl@plt>
add    $0x4,%rbx
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @_dns_parse_uint32(i8** %0) {
%2 = alloca i8**
%3 = alloca i32*
%4 = alloca i32
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = load i8*, i8** %5
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %3
%8 = load i32*, i32** %3
%9 = load i32, i32* %8
%10 = call i32 @ntohl(i32 %9)
store i32 %10, i32* %4
%11 = load i8**, i8*** %2
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i64 4
store i8* %13, i8** %11
%14 = load i32, i32* %4
ret i32 %14
}

LLVM IR (-O2):
define i32 @_dns_parse_uint32(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = bitcast i8* %2 to i32*
%4 = load i32, i32* %3
%5 = tail call i32 @ntohl(i32 %4)
%6 = getelementptr inbounds i8, i8* %2, i64 4
store i8* %6, i8** %0
ret i32 %5
}
int is_sandybridge(unsigned short pciid) {
  return ((pciid) == 0x0102 || (pciid) == 0x0112 || (pciid) == 0x0122 ||
          (pciid) == 0x0106 || (pciid) == 0x0116 || (pciid) == 0x0126 ||
          (pciid) == 0x010A);
}


x86 assembly (clang, -O0):
<is_sandybridge>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x102,%ecx
mov    %al,-0x3(%rbp)
je     1198 <is_sandybridge+0x98>
movzwl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x112,%ecx
mov    %al,-0x3(%rbp)
je     1198 <is_sandybridge+0x98>
movzwl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x122,%ecx
mov    %al,-0x3(%rbp)
je     1198 <is_sandybridge+0x98>
movzwl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x106,%ecx
mov    %al,-0x3(%rbp)
je     1198 <is_sandybridge+0x98>
movzwl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x116,%ecx
mov    %al,-0x3(%rbp)
je     1198 <is_sandybridge+0x98>
movzwl -0x2(%rbp),%ecx
mov    $0x1,%al
cmp    $0x126,%ecx
mov    %al,-0x3(%rbp)
je     1198 <is_sandybridge+0x98>
movzwl -0x2(%rbp),%eax
cmp    $0x10a,%eax
sete   %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sandybridge>:
lea    -0x102(%rdi),%ecx
rol    $0xe,%cx
cmp    $0xa,%cx
jae    111f <is_sandybridge+0x1f>
mov    $0x1,%eax
mov    $0x333,%edx
bt     %ecx,%edx
jb     112d <is_sandybridge+0x2d>
movzwl %di,%ecx
xor    %eax,%eax
cmp    $0x10a,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @is_sandybridge(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = icmp eq i32 %4, 258
br i1 %5, label %30, label %6
6: ; preds = %1
%7 = load i16, i16* %2
%8 = zext i16 %7 to i32
%9 = icmp eq i32 %8, 274
br i1 %9, label %30, label %10
10: ; preds = %6
%11 = load i16, i16* %2
%12 = zext i16 %11 to i32
%13 = icmp eq i32 %12, 290
br i1 %13, label %30, label %14
14: ; preds = %10
%15 = load i16, i16* %2
%16 = zext i16 %15 to i32
%17 = icmp eq i32 %16, 262
br i1 %17, label %30, label %18
18: ; preds = %14
%19 = load i16, i16* %2
%20 = zext i16 %19 to i32
%21 = icmp eq i32 %20, 278
br i1 %21, label %30, label %22
22: ; preds = %18
%23 = load i16, i16* %2
%24 = zext i16 %23 to i32
%25 = icmp eq i32 %24, 294
br i1 %25, label %30, label %26
26: ; preds = %22
%27 = load i16, i16* %2
%28 = zext i16 %27 to i32
%29 = icmp eq i32 %28, 266
br label %30
30: ; preds = %26, %22, %18, %14, %10, %6, %1
%31 = phi i1 [ true, %22 ], [ true, %18 ], [ true, %14 ], [ true, %10 ], [ true, %6 ], [ true, %1 ], [ %29, %26 ]
%32 = zext i1 %31 to i32
ret i32 %32
}

LLVM IR (-O2):
define i32 @is_sandybridge(i16 zeroext %0) {
%2 = add i16 %0, -258
%3 = tail call i16 @llvm.fshl.i16(i16 %2, i16 %2, i16 14)
%4 = icmp ult i16 %3, 10
br i1 %4, label %8, label %5
5: ; preds = %8, %1
%6 = icmp eq i16 %0, 266
%7 = zext i1 %6 to i32
br label %12
8: ; preds = %1
%9 = lshr i16 819, %3
%10 = and i16 %9, 1
%11 = icmp eq i16 %10, 0
br i1 %11, label %5, label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ 1, %8 ]
ret i32 %13
}
int pci_bus_scan(struct pci_dev_info *dev_info) { return 1; }


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

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

LLVM IR (-O0):
%struct.pci_dev_info = type opaque
define i32 @pci_bus_scan(%struct.pci_dev_info* %0) {
%2 = alloca %struct.pci_dev_info*
store %struct.pci_dev_info* %0, %struct.pci_dev_info** %2
ret i32 1
}

LLVM IR (-O2):
%struct.pci_dev_info = type opaque
define i32 @pci_bus_scan(%struct.pci_dev_info* nocapture readnone %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ BGBMID_ScaleSample2H(short *, int, short *, int);
int BGBMID_ScaleSampleStereo(short *d, int dl, short *s, int sl) {
  BGBMID_ScaleSample2H(d + 0, dl, s + 0, sl);
  BGBMID_ScaleSample2H(d + 1, dl, s + 1, sl);
  return (0);
}


x86 assembly (clang, -O0):
<BGBMID_ScaleSampleStereo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <BGBMID_ScaleSample2H@plt>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
add    $0x2,%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <BGBMID_ScaleSample2H@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BGBMID_ScaleSampleStereo>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %rdi,%rbp
call   1030 <BGBMID_ScaleSample2H@plt>
add    $0x2,%rbp
add    $0x2,%rbx
mov    %rbp,%rdi
mov    %r15d,%esi
mov    %rbx,%rdx
mov    %r14d,%ecx
call   1030 <BGBMID_ScaleSample2H@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @BGBMID_ScaleSampleStereo(i16* %0, i32 %1, i16* %2, i32 %3) {
%5 = alloca i16*
%6 = alloca i32
%7 = alloca i16*
%8 = alloca i32
store i16* %0, i16** %5
store i32 %1, i32* %6
store i16* %2, i16** %7
store i32 %3, i32* %8
%9 = load i16*, i16** %5
%10 = getelementptr inbounds i16, i16* %9, i64 0
%11 = load i32, i32* %6
%12 = load i16*, i16** %7
%13 = getelementptr inbounds i16, i16* %12, i64 0
%14 = load i32, i32* %8
%15 = call i32 @BGBMID_ScaleSample2H(i16* %10, i32 %11, i16* %13, i32 %14)
%16 = load i16*, i16** %5
%17 = getelementptr inbounds i16, i16* %16, i64 1
%18 = load i32, i32* %6
%19 = load i16*, i16** %7
%20 = getelementptr inbounds i16, i16* %19, i64 1
%21 = load i32, i32* %8
%22 = call i32 @BGBMID_ScaleSample2H(i16* %17, i32 %18, i16* %20, i32 %21)
ret i32 0
}

LLVM IR (-O2):
define i32 @BGBMID_ScaleSampleStereo(i16* %0, i32 %1, i16* %2, i32 %3) {
%5 = tail call i32 @BGBMID_ScaleSample2H(i16* %0, i32 %1, i16* %2, i32 %3)
%6 = getelementptr inbounds i16, i16* %0, i64 1
%7 = getelementptr inbounds i16, i16* %2, i64 1
%8 = tail call i32 @BGBMID_ScaleSample2H(i16* %6, i32 %1, i16* %7, i32 %3)
ret i32 0
}
int difference(int a, int b) { return a - b; }


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

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

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

LLVM IR (-O2):
define i32 @difference(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
void ufshpb_init_hpb_lu(struct ufs_hba *hba, struct scsi_device *sdev) {}


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

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

LLVM IR (-O0):
%struct.ufs_hba = type opaque
%struct.scsi_device = type opaque
define void @ufshpb_init_hpb_lu(%struct.ufs_hba* %0, %struct.scsi_device* %1) {
%3 = alloca %struct.ufs_hba*
%4 = alloca %struct.scsi_device*
store %struct.ufs_hba* %0, %struct.ufs_hba** %3
store %struct.scsi_device* %1, %struct.scsi_device** %4
ret void
}

LLVM IR (-O2):
%struct.ufs_hba = type opaque
%struct.scsi_device = type opaque
define void @ufshpb_init_hpb_lu(%struct.ufs_hba* nocapture %0, %struct.scsi_device* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Hello word from Hamad!\n");
  printf("i learnd that 2+2=%d,!\n", 4);
  printf("The grade am working for is %c!\n", 'A');
  printf("The temperature outside is barely %f!\n", 32.00000);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x41,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
movsd  0xe9e(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf40(%rip),%rdi
call   1030 <puts@plt>
lea    0xed4(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x41,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
movsd  0xe9e(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Hello word from Hamad!\0A\00"
@.str.1 = [24 x i8] c"i learnd that 2+2=%d,!\0A\00"
@.str.2 = [33 x i8] c"The grade am working for is %c!\0A\00"
@.str.3 = [39 x i8] c"The temperature outside is barely %f!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 4)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 65)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), double 3.200000e+01)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"i learnd that 2+2=%d,!\0A\00"
@.str.2 = [33 x i8] c"The grade am working for is %c!\0A\00"
@.str.3 = [39 x i8] c"The temperature outside is barely %f!\0A\00"
@str = [23 x i8] c"Hello word from Hamad!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 4)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 65)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.3, i64 0, i64 0), double 3.200000e+01)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ powercap_rapl_get_num_instances();
uint32_t powercap_rapl_get_num_packages(void) {
  return powercap_rapl_get_num_instances();
}


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

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

LLVM IR (-O0):
define i32 @powercap_rapl_get_num_packages() {
%1 = call i32 (...) @powercap_rapl_get_num_instances()
ret i32 %1
}

LLVM IR (-O2):
define i32 @powercap_rapl_get_num_packages() {
%1 = tail call i32 (...) @powercap_rapl_get_num_instances()
ret i32 %1
}
int search_char_in_string(const char *p, char ch) {
  int i;
  for (i = 0; '\0' != *p; i++) {
    if (p[i] == ch) {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<search_char_in_string>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     115c <search_char_in_string+0x5c>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1149 <search_char_in_string+0x49>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <search_char_in_string+0x63>
jmp    114e <search_char_in_string+0x4e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1115 <search_char_in_string+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_char_in_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     111f <search_char_in_string+0x1f>
xor    %eax,%eax
cmp    %sil,%cl
je     111e <search_char_in_string+0x1e>
xor    %eax,%eax
nop
mov    %rax,%rcx
add    $0x1,%rax
cmp    %sil,0x1(%rdi,%rcx,1)
jne    1110 <search_char_in_string+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @search_char_in_string(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2
%6 = icmp eq i8 %3, %1
br i1 %6, label %15, label %7
7: ; preds = %5, %7
%8 = phi i64 [ %9, %7 ], [ 0, %5 ]
%9 = add nuw i64 %8, 1
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, %1
br i1 %12, label %13, label %7
13: ; preds = %7
%14 = trunc i64 %9 to i32
br label %15
15: ; preds = %5, %13, %2
%16 = phi i32 [ -1, %2 ], [ %14, %13 ], [ 0, %5 ]
ret i32 %16
}
/* Type definitions */
struct window {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct window *);
void window_free(struct window *win) { free(win); }


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

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

LLVM IR (-O0):
%struct.window = type { i32 }
define void @window_free(%struct.window* %0) {
%2 = alloca %struct.window*
store %struct.window* %0, %struct.window** %2
%3 = load %struct.window*, %struct.window** %2
%4 = call i32 @free(%struct.window* %3)
ret void
}

LLVM IR (-O2):
%struct.window = type { i32 }
define void @window_free(%struct.window* nocapture %0) {
%2 = tail call i32 @free(%struct.window* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ drop();
int /*<<< orphan*/ unnest();
void Dendif(void) {
  drop();
  unnest();
}


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

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

LLVM IR (-O0):
define void @Dendif() {
%1 = call i32 (...) @drop()
%2 = call i32 (...) @unnest()
ret void
}

LLVM IR (-O2):
define void @Dendif() {
%1 = tail call i32 (...) @drop()
%2 = tail call i32 (...) @unnest()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hanoi(int, char, char, char);
int main() {
  int ceil = 3;
  hanoi(ceil, 'A', 'B', 'C');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1030 <hanoi@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x41,%esi
mov    $0x42,%edx
mov    $0x43,%ecx
call   1030 <hanoi@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @hanoi(i32 %3, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @hanoi(i32 3, i8 signext 65, i8 signext 66, i8 signext 67)
ret i32 0
}
int quickwakeup_execute(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @quickwakeup_execute() {
ret i32 0
}
int test_imm_42uint16_mem(unsigned short *val) {
  return ((*val) & (-0x42 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_42uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -66
%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_42uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -66
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int device_wipe_data() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @device_wipe_data() {
ret i32 0
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
double stdlib_strided_dsnansum(int, float *, int);
int main() {
  float x[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 0.0 / 0.0, 0.0 / 0.0};
  int64_t N = 5;
  int64_t stride = 2;
  double v = stdlib_strided_dsnansum(N, x, stride);
  printf("sum: %lf\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
movl   $0x5,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x34(%rbp),%edi
lea    -0x30(%rbp),%rsi
mov    -0x38(%rbp),%edx
call   1040 <stdlib_strided_dsnansum@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x5,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_dsnansum@plt>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = bitcast [10 x float]* %1 to i8*
store i32 5, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call double @stdlib_strided_dsnansum(i32 %6, float* %7, i32 %8)
store double %9, double* %4
%10 = load double, double* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [10 x float] [float 1.000000e+00, float 2.000000e+00, float 3.000000e+00, float 4.000000e+00, float 5.000000e+00, float 6.000000e+00, float 7.000000e+00, float 8.000000e+00, float 0x7FF8000000000000, float 0x7FF8000000000000]
@.str = [10 x i8] c"sum: %lf\0A\00"
define i32 @main() {
%1 = alloca [10 x float]
%2 = bitcast [10 x float]* %1 to i8*
%3 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%4 = call double @stdlib_strided_dsnansum(i32 5, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %4)
ret i32 0
}