xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ md5_simple(char const *, size_t, int /*<<< orphan*/ *);
uint32_t md5_simple32(const char *data, size_t len) {
  uint32_t buf[4];
  md5_simple(data, len, buf);
  return buf[0];
}


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

x86 assembly (clang, -O2):
<md5_simple32>:
sub    $0x18,%rsp
mov    %rsp,%rdx
call   1030 <md5_simple@plt>
mov    (%rsp),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @md5_simple32(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca [4 x i32]
store i8* %0, i8** %3
store i64 %1, i64* %4
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%9 = call i32 @md5_simple(i8* %6, i64 %7, i32* %8)
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%11 = load i32, i32* %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @md5_simple32(i8* %0, i64 %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @md5_simple(i8* %0, i64 %1, i32* %5)
%7 = load i32, i32* %5
ret i32 %7
}
int isalnum(int c) {
  return ((c >= 0x30 && c <= 0x39) || (c >= 0x41 && c <= 0x5A) ||
          (c >= 0x61 && c <= 0x7A));
}


x86 assembly (clang, -O0):
<isalnum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x30,-0x4(%rbp)
jl     1120 <isalnum+0x20>
mov    $0x1,%al
cmpl   $0x39,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isalnum+0x58>
cmpl   $0x41,-0x4(%rbp)
jl     1139 <isalnum+0x39>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    1158 <isalnum+0x58>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1152 <isalnum+0x52>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalnum>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x1a,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isalnum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br i1 %7, label %22, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 65
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 90
br i1 %13, label %22, label %14
14: ; preds = %11, %8
%15 = load i32, i32* %2
%16 = icmp sge i32 %15, 97
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %2
%19 = icmp sle i32 %18, 122
br label %20
20: ; preds = %17, %14
%21 = phi i1 [ false, %14 ], [ %19, %17 ]
br label %22
22: ; preds = %20, %11, %5
%23 = phi i1 [ true, %11 ], [ true, %5 ], [ %21, %20 ]
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @isalnum(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 26
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ BNCIO(int);
long int BNCPulse() {
  long int stat = 99;
  BNCIO(23);
  return (stat);
}


x86 assembly (clang, -O0):
<BNCPulse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x63,-0x8(%rbp)
mov    $0x17,%edi
call   1030 <BNCIO@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BNCPulse>:
push   %rax
mov    $0x17,%edi
call   1030 <BNCIO@plt>
mov    $0x63,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i64 @BNCPulse() {
%1 = alloca i64
store i64 99, i64* %1
%2 = call i32 @BNCIO(i32 23)
%3 = load i64, i64* %1
ret i64 %3
}

LLVM IR (-O2):
define i64 @BNCPulse() {
%1 = tail call i32 @BNCIO(i32 23)
ret i64 99
}
void led_on(int led) {
  (*(volatile unsigned long *)(0xE0028000 + 0x1C)) |= led;
}


x86 assembly (clang, -O0):
<led_on>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
mov    $0xe002801c,%ecx
mov    (%rcx),%rcx
or     %rax,%rcx
mov    $0xe002801c,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_on>:
movslq %edi,%rax
mov    $0xe002801c,%ecx
or     %rax,(%rcx)
ret

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

LLVM IR (-O2):
define void @led_on(i32 %0) {
%2 = sext i32 %0 to i64
%3 = load volatile i64, i64* inttoptr (i64 3758260252 to i64*)
%4 = or i64 %3, %2
store volatile i64 %4, i64* inttoptr (i64 3758260252 to i64*)
ret void
}
void ComparatorIntEnable(unsigned long ulBase, unsigned long ulComp) {
  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 1 << ulComp;
}


x86 assembly (clang, -O0):
<ComparatorIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rdx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     %rdx,%rcx
mov    %rcx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ComparatorIntEnable>:
mov    %rsi,%rcx
mov    $0x1,%eax
shl    %cl,%eax
cltq
or     %rax,0x8(%rdi)
ret

LLVM IR (-O0):
define void @ComparatorIntEnable(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 = trunc i64 %5 to i32
%7 = shl i32 1, %6
%8 = sext i32 %7 to i64
%9 = load i64, i64* %3
%10 = add i64 %9, 8
%11 = inttoptr i64 %10 to i64*
%12 = load volatile i64, i64* %11
%13 = or i64 %12, %8
store volatile i64 %13, i64* %11
ret void
}

LLVM IR (-O2):
define void @ComparatorIntEnable(i64 %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = shl nuw i32 1, %3
%5 = sext i32 %4 to i64
%6 = add i64 %0, 8
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, %5
store volatile i64 %9, i64* %7
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
size_t utf32_to_utf8_size_1(uint32_t c) {
  size_t size = 1;
  size += c >= 0x80;
  size += c >= 0x800;
  size += c >= 0x10000;
  return c < 0x200000 ? size : 0;
}


x86 assembly (clang, -O0):
<utf32_to_utf8_size_1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x1,-0x10(%rbp)
cmpl   $0x80,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x800,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x10000,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x200000,-0x4(%rbp)
jge    1174 <utf32_to_utf8_size_1+0x74>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    117f <utf32_to_utf8_size_1+0x7f>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    117f <utf32_to_utf8_size_1+0x7f>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf32_to_utf8_size_1>:
xor    %eax,%eax
cmp    $0x7f,%edi
setg   %al
xor    %ecx,%ecx
cmp    $0x800,%edi
setge  %cl
add    %rax,%rcx
xor    %eax,%eax
cmp    $0x10000,%edi
setge  %al
add    %rax,%rcx
add    $0x1,%rcx
xor    %eax,%eax
cmp    $0x200000,%edi
cmovl  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @utf32_to_utf8_size_1(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 1, i64* %3
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 128
%6 = zext i1 %5 to i32
%7 = sext i32 %6 to i64
%8 = load i64, i64* %3
%9 = add i64 %8, %7
store i64 %9, i64* %3
%10 = load i32, i32* %2
%11 = icmp sge i32 %10, 2048
%12 = zext i1 %11 to i32
%13 = sext i32 %12 to i64
%14 = load i64, i64* %3
%15 = add i64 %14, %13
store i64 %15, i64* %3
%16 = load i32, i32* %2
%17 = icmp sge i32 %16, 65536
%18 = zext i1 %17 to i32
%19 = sext i32 %18 to i64
%20 = load i64, i64* %3
%21 = add i64 %20, %19
store i64 %21, i64* %3
%22 = load i32, i32* %2
%23 = icmp slt i32 %22, 2097152
br i1 %23, label %24, label %26
24: ; preds = %1
%25 = load i64, i64* %3
br label %27
26: ; preds = %1
br label %27
27: ; preds = %26, %24
%28 = phi i64 [ %25, %24 ], [ 0, %26 ]
ret i64 %28
}

LLVM IR (-O2):
define i64 @utf32_to_utf8_size_1(i32 %0) {
%2 = icmp sgt i32 %0, 127
%3 = select i1 %2, i64 2, i64 1
%4 = icmp sgt i32 %0, 2047
%5 = zext i1 %4 to i64
%6 = add nuw nsw i64 %3, %5
%7 = icmp sgt i32 %0, 65535
%8 = zext i1 %7 to i64
%9 = add nuw nsw i64 %6, %8
%10 = icmp slt i32 %0, 2097152
%11 = select i1 %10, i64 %9, i64 0
ret i64 %11
}
void foo413(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo413(i32 %0) {
ret void
}
void destructor_deinit(struct consumer_workspace *ws) {}


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

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

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

LLVM IR (-O2):
%struct.consumer_workspace = type opaque
define void @destructor_deinit(%struct.consumer_workspace* nocapture %0) {
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFIFO;
int stat(char *, struct stat *);
int fifo_exists(char *filename) {
  struct stat fifo_stat;
  int stat_status;
  if ((stat_status = stat(filename, &fifo_stat)) < 0) {
    return -1;
  }
  if (fifo_stat.st_mode & S_IFIFO) {
    return 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<fifo_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
jge    1141 <fifo_exists+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <fifo_exists+0x59>
mov    -0x18(%rbp),%eax
mov    0x2e95(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1162 <fifo_exists+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1169 <fifo_exists+0x59>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fifo_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %eax,%eax
js     1133 <fifo_exists+0x23>
mov    0x2ebc(%rip),%rax
mov    (%rax),%eax
and    (%rsp),%eax
cmp    $0x1,%eax
sbb    %eax,%eax
or     $0x1,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFIFO = global i32 0
define i32 @fifo_exists(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @stat(i8* %6, %struct.stat* %4)
store i32 %7, i32* %5
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 -1, i32* %2
br label %18
10: ; preds = %1
%11 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%12 = load i32, i32* %11
%13 = load i32, i32* @S_IFIFO
%14 = and i32 %12, %13
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %10
store i32 1, i32* %2
br label %18
17: ; preds = %10
store i32 -1, i32* %2
br label %18
18: ; preds = %17, %16, %9
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFIFO = global i32 0
define i32 @fifo_exists(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %13, label %6
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @S_IFIFO
%10 = and i32 %9, %8
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 -1, i32 1
br label %13
13: ; preds = %6, %1
%14 = phi i32 [ -1, %1 ], [ %12, %6 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
unsigned long djb2(const char *str) {
  unsigned long hash = 5381;
  int c;
  assert(str != NULL);
  while ((c = *str++))
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<djb2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     1170 <djb2+0x60>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1136 <djb2+0x26>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<djb2>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%cl
test   %cl,%cl
je     115e <djb2+0x4e>
add    $0x1,%rbx
mov    $0x1505,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1140 <djb2+0x30>
pop    %rbx
ret
mov    $0x1505,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i64 @djb2(i8* %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %17, label %7
7: ; preds = %1, %7
%8 = phi i8 [ %15, %7 ], [ %5, %1 ]
%9 = phi i8* [ %11, %7 ], [ %0, %1 ]
%10 = phi i64 [ %14, %7 ], [ 5381, %1 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = mul i64 %10, 33
%13 = sext i8 %8 to i64
%14 = add i64 %12, %13
%15 = load i8, i8* %11
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %7
17: ; preds = %7, %1
%18 = phi i64 [ 5381, %1 ], [ %14, %7 ]
ret i64 %18
}
/* Variables and functions */
int /*<<< orphan*/ block_first_sem(int);
void wait_client(int semid) { block_first_sem(semid); }


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

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

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

LLVM IR (-O2):
define void @wait_client(i32 %0) {
%2 = tail call i32 @block_first_sem(i32 %0)
ret void
}
/* Type definitions */
struct sockaddr_storage {
  int dummy;
};
struct sockaddr {
  int dummy;
};

/* Variables and functions */
scalar_t__ sendto(int, void const *, size_t, int /*<<< orphan*/,
                  struct sockaddr const *, int);
int sendpacket(int fd, const void *p, size_t n,
               const struct sockaddr_storage *a) {
  return sendto(fd, p, n, 0, (const struct sockaddr *)a, sizeof *a) < 0;
}


x86 assembly (clang, -O0):
<sendpacket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r8
xor    %ecx,%ecx
mov    $0x4,%r9d
call   1030 <sendto@plt>
cmp    $0x0,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendpacket>:
push   %rax
mov    %rcx,%r8
xor    %ecx,%ecx
mov    $0x4,%r9d
call   1030 <sendto@plt>
shr    $0x3f,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @sendpacket(i32 %0, i8* %1, i64 %2, %struct.sockaddr_storage* %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca %struct.sockaddr_storage*
store i32 %0, i32* %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store %struct.sockaddr_storage* %3, %struct.sockaddr_storage** %8
%9 = load i32, i32* %5
%10 = load i8*, i8** %6
%11 = load i64, i64* %7
%12 = load %struct.sockaddr_storage*, %struct.sockaddr_storage** %8
%13 = bitcast %struct.sockaddr_storage* %12 to %struct.sockaddr*
%14 = call i64 @sendto(i32 %9, i8* %10, i64 %11, i32 0, %struct.sockaddr* %13, i32 4)
%15 = icmp slt i64 %14, 0
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
define i32 @sendpacket(i32 %0, i8* %1, i64 %2, %struct.sockaddr_storage* %3) {
%5 = bitcast %struct.sockaddr_storage* %3 to %struct.sockaddr*
%6 = tail call i64 @sendto(i32 %0, i8* %1, i64 %2, i32 0, %struct.sockaddr* %5, i32 4)
%7 = lshr i64 %6, 63
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Type definitions */
struct ndz_rangemap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void chunkfunc(struct ndz_rangemap *map, void *ptr) {
  unsigned int chunkno = (uintptr_t)ptr;
  printf("chunkno=%u", chunkno);
}


x86 assembly (clang, -O0):
<chunkfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.ndz_rangemap = type { i32 }
@.str = [11 x i8] c"chunkno=%u\00"
define void @chunkfunc(%struct.ndz_rangemap* %0, i8* %1) {
%3 = alloca %struct.ndz_rangemap*
%4 = alloca i8*
%5 = alloca i32
store %struct.ndz_rangemap* %0, %struct.ndz_rangemap** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = ptrtoint i8* %6 to i64
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
%struct.ndz_rangemap = type { i32 }
@.str = [11 x i8] c"chunkno=%u\00"
define void @chunkfunc(%struct.ndz_rangemap* nocapture readnone %0, i8* %1) {
%3 = ptrtoint i8* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
const char *mz_version(void) { return "10.1.0"; }


x86 assembly (clang, -O0):
<mz_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mz_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"10.1.0\00"
define i8* @mz_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"10.1.0\00"
define i8* @mz_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int usleep(size_t);
int sleep_ms(size_t time) { return usleep(time); }


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

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

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

LLVM IR (-O2):
define i32 @sleep_ms(i64 %0) {
%2 = tail call i32 @usleep(i64 %0)
ret i32 %2
}
void b43legacy_rfkill_init(struct b43legacy_wldev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.b43legacy_wldev = type opaque
define void @b43legacy_rfkill_init(%struct.b43legacy_wldev* nocapture %0) {
ret void
}
/* Variables and functions */
size_t strlen(const char *s) {
  size_t len = 0;
  while (*s++ != '\0')
    len++;
  return (len);
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113c <strlen+0x3c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
cmpb   $0x0,(%rdi)
je     111f <strlen+0x1f>
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
lea    0x1(%rcx),%rax
cmpb   $0x0,0x1(%rdi,%rcx,1)
mov    %rax,%rcx
jne    1110 <strlen+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @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 = getelementptr inbounds i8, i8* %5, i32 1
store i8* %6, i8** %2
%7 = load i8, i8* %5
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %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 @strlen(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add i64 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i64 [ 0, %1 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
scalar_t__ malloc(int);
int hideemail_init(void **userdata, int num_fields, const char **field_names,
                   const char *options, char *error_message) {
  *userdata = (void *)malloc(sizeof(char) * 256);
  return 0;
}


x86 assembly (clang, -O0):
<hideemail_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    $0x100,%edi
call   1030 <malloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hideemail_init>:
push   %rbx
mov    %rdi,%rbx
mov    $0x100,%edi
call   1030 <malloc@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @hideemail_init(i8** %0, i32 %1, i8** %2, i8* %3, i8* %4) {
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i8**
%9 = alloca i8*
%10 = alloca i8*
store i8** %0, i8*** %6
store i32 %1, i32* %7
store i8** %2, i8*** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = call i64 @malloc(i32 256)
%12 = inttoptr i64 %11 to i8*
%13 = load i8**, i8*** %6
store i8* %12, i8** %13
ret i32 0
}

LLVM IR (-O2):
define i32 @hideemail_init(i8** nocapture writeonly %0, i32 %1, i8** nocapture readnone %2, i8* nocapture readnone %3, i8* nocapture readnone %4) {
%6 = tail call i64 @malloc(i32 256)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %0
ret i32 0
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ putchar(char);
int getline(char *buf) {
  char c;
  int nc = 0;
  while ((c = getchar()) != '\r') {
    putchar(c);
    *buf++ = c;
    nc++;
  }
  return nc;
}


x86 assembly (clang, -O0):
<getline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0xd,%eax
je     1174 <getline+0x54>
movsbl -0x9(%rbp),%edi
call   1030 <putchar@plt>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1133 <getline+0x13>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getline>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    $0xd,%al
je     115d <getline+0x3d>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %bpl,(%r14,%rbx,1)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%rbx
cmp    $0xd,%al
jne    1140 <getline+0x20>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @getline(i8* nocapture writeonly %0) {
%2 = tail call signext i8 (...) @getchar()
%3 = icmp eq i8 %2, 13
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = tail call i32 @putchar(i8 signext %5)
%9 = getelementptr inbounds i8, i8* %7, i64 1
store i8 %5, i8* %7
%10 = add nuw nsw i32 %6, 1
%11 = tail call signext i8 (...) @getchar()
%12 = icmp eq i8 %11, 13
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %10, %4 ]
ret i32 %14
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
scalar_t__ UINT64_C(int);
bool CGROUP_WEIGHT_IS_OK(uint64_t x) {
  return x == ((uint64_t)-1) || (x >= UINT64_C(1) && x <= UINT64_C(10000));
}


x86 assembly (clang, -O0):
<CGROUP_WEIGHT_IS_OK>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%al
cmpq   $0xffffffffffffffff,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     117b <CGROUP_WEIGHT_IS_OK+0x6b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    -0x18(%rbp),%rcx
mov    %rax,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
mov    %al,-0xa(%rbp)
jl     1175 <CGROUP_WEIGHT_IS_OK+0x65>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0x2710,%edi
call   1030 <UINT64_C@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
setle  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CGROUP_WEIGHT_IS_OK>:
push   %rbx
cmp    $0xffffffffffffffff,%rdi
je     1145 <CGROUP_WEIGHT_IS_OK+0x35>
mov    %rdi,%rbx
mov    $0x1,%edi
call   1030 <UINT64_C@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
jg     1143 <CGROUP_WEIGHT_IS_OK+0x33>
mov    $0x2710,%edi
call   1030 <UINT64_C@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rbx,%rcx
setge  %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @CGROUP_WEIGHT_IS_OK(i64 %0) {
%2 = icmp eq i64 %0, -1
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @UINT64_C(i32 1)
%5 = icmp sgt i64 %4, %0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @UINT64_C(i32 10000)
%8 = icmp sge i64 %7, %0
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %3, %6, %1
%11 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %9, %6 ]
ret i32 %11
}
int dummy_function(const char *str) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dummy_function(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ArgItem();
int /*<<< orphan*/ Me();
int /*<<< orphan*/ StartSnoop(int /*<<< orphan*/, int /*<<< orphan*/, int);
void Act_Snoop(void) { StartSnoop(Me(), ArgItem(), 1); }


x86 assembly (clang, -O0):
<Act_Snoop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <Me@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <ArgItem@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
mov    $0x1,%edx
call   1030 <StartSnoop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_Snoop>:
push   %rbx
xor    %eax,%eax
call   1050 <Me@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <ArgItem@plt>
mov    %ebx,%edi
mov    %eax,%esi
mov    $0x1,%edx
pop    %rbx
jmp    1030 <StartSnoop@plt>

LLVM IR (-O0):
define void @Act_Snoop() {
%1 = call i32 (...) @Me()
%2 = call i32 (...) @ArgItem()
%3 = call i32 @StartSnoop(i32 %1, i32 %2, i32 1)
ret void
}

LLVM IR (-O2):
define void @Act_Snoop() {
%1 = tail call i32 (...) @Me()
%2 = tail call i32 (...) @ArgItem()
%3 = tail call i32 @StartSnoop(i32 %1, i32 %2, i32 1)
ret void
}
int getsectorspertrack(int endcyl) {
  int sectors_per_track = 0;
  sectors_per_track = endcyl & 63;
  return sectors_per_track;
}


x86 assembly (clang, -O0):
<getsectorspertrack>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3f,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsectorspertrack>:
mov    %edi,%eax
and    $0x3f,%eax
ret

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

LLVM IR (-O2):
define i32 @getsectorspertrack(i32 %0) {
%2 = and i32 %0, 63
ret i32 %2
}
void set_free(char *p) { *p = (char)(1 << 7); }


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

x86 assembly (clang, -O2):
<set_free>:
movb   $0x80,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_free(i8* nocapture writeonly %0) {
store i8 -128, i8* %0
ret void
}
/* Variables and functions */
unsigned char dxl_read_byte(unsigned char, int);
unsigned char getLowestVoltageLimit(unsigned char id) {
  return dxl_read_byte(id, (12));
}


x86 assembly (clang, -O0):
<getLowestVoltageLimit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0xc,%esi
movzbl -0x1(%rbp),%edi
call   1030 <dxl_read_byte@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getLowestVoltageLimit>:
mov    $0xc,%esi
jmp    1030 <dxl_read_byte@plt>

LLVM IR (-O0):
define zeroext i8 @getLowestVoltageLimit(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @dxl_read_byte(i8 zeroext %3, i32 12)
ret i8 %4
}

LLVM IR (-O2):
define zeroext i8 @getLowestVoltageLimit(i8 zeroext %0) {
%2 = tail call zeroext i8 @dxl_read_byte(i8 zeroext %0, i32 12)
ret i8 %2
}
/* Variables and functions */
int GPTLerror(char *, char const *);
int init_mpiwtime() {
  static const char *thisfunc = "init_mpiwtime";
  return GPTLerror("%s: not enabled\n", thisfunc);
}


x86 assembly (clang, -O0):
<init_mpiwtime>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f0d(%rip),%rsi
lea    0xeec(%rip),%rdi
call   1030 <GPTLerror@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_mpiwtime>:
lea    0xef7(%rip),%rdi
lea    0xee2(%rip),%rsi
jmp    1030 <GPTLerror@plt>

LLVM IR (-O0):
@init_mpiwtime.thisfunc = internal global i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i32 0, i32 0)
@.str = [14 x i8] c"init_mpiwtime\00"
@.str.1 = [17 x i8] c"%s: not enabled\0A\00"
define i32 @init_mpiwtime() {
%1 = load i8*, i8** @init_mpiwtime.thisfunc
%2 = call i32 @GPTLerror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [14 x i8] c"init_mpiwtime\00"
@.str.1 = [17 x i8] c"%s: not enabled\0A\00"
define i32 @init_mpiwtime() {
%1 = tail call i32 @GPTLerror(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
char get_y_from_position(int position) { return (position % 10); }


x86 assembly (clang, -O0):
<get_y_from_position>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_y_from_position>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @get_y_from_position(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 10
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @get_y_from_position(i32 %0) {
%2 = srem i32 %0, 10
%3 = trunc i32 %2 to i8
ret i8 %3
}
/* Type definitions */
struct dirent {
  int /*<<< orphan*/ d_name;
};

/* Variables and functions */
int strcasecmp(int /*<<< orphan*/, int /*<<< orphan*/);
int alphaCmp(void *a, void *b) {
  return strcasecmp((*(struct dirent **)b)->d_name,
                    (*(struct dirent **)a)->d_name);
}


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

x86 assembly (clang, -O2):
<alphaCmp>:
mov    (%rsi),%rax
mov    (%rax),%eax
mov    (%rdi),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
jmp    1030 <strcasecmp@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @alphaCmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.dirent**
%7 = load %struct.dirent*, %struct.dirent** %6
%8 = getelementptr inbounds %struct.dirent, %struct.dirent* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to %struct.dirent**
%12 = load %struct.dirent*, %struct.dirent** %11
%13 = getelementptr inbounds %struct.dirent, %struct.dirent* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @strcasecmp(i32 %9, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @alphaCmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to %struct.dirent**
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = bitcast i8* %0 to %struct.dirent**
%8 = load %struct.dirent*, %struct.dirent** %7
%9 = getelementptr inbounds %struct.dirent, %struct.dirent* %8, i64 0, i32 0
%10 = load i32, i32* %9
%11 = tail call i32 @strcasecmp(i32 %6, i32 %10)
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ glutSwapBuffers();
void post_display(void) { glutSwapBuffers(); }


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

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

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

LLVM IR (-O2):
define void @post_display() {
%1 = tail call i32 (...) @glutSwapBuffers()
ret void
}
int wl_noop(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @wl_noop() {
ret i32 0
}
/* Type definitions */
struct timeb {
  int time;
  scalar_t__ millitm;
};

/* Variables and functions */
int /*<<< orphan*/ ftime(struct timeb *);
long millis() {
  struct timeb tb;
  ftime(&tb);
  return (long)(tb.time * 1000 + tb.millitm);
}


x86 assembly (clang, -O0):
<millis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
call   1030 <ftime@plt>
imul   $0x3e8,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<millis>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
call   1030 <ftime@plt>
movslq 0x8(%rsp),%rax
imul   $0x3e8,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeb = type { i32, i64 }
define i64 @millis() {
%1 = alloca %struct.timeb
%2 = call i32 @ftime(%struct.timeb* %1)
%3 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add nsw i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeb = type { i32, i64 }
define i64 @millis() {
%1 = alloca %struct.timeb
%2 = bitcast %struct.timeb* %1 to i8*
%3 = call i32 @ftime(%struct.timeb* %1)
%4 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeb, %struct.timeb* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add nsw i64 %9, %7
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int putc(int, int /*<<< orphan*/ *);
int write_long(FILE *fp, int l) {
  putc(l, fp);
  putc(l >> 8, fp);
  putc(l >> 16, fp);
  return (putc(l >> 24, fp));
}


x86 assembly (clang, -O0):
<write_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
sar    $0x8,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
sar    $0x10,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
mov    -0xc(%rbp),%edi
sar    $0x18,%edi
mov    -0x8(%rbp),%rsi
call   1030 <putc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_long>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %ebx,%edi
sar    $0x8,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
mov    %ebx,%edi
sar    $0x10,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
sar    $0x18,%ebx
mov    %ebx,%edi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putc@plt>

LLVM IR (-O0):
define i32 @write_long(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 = call i32 @putc(i32 %5, i32* %6)
%8 = load i32, i32* %4
%9 = ashr i32 %8, 8
%10 = load i32*, i32** %3
%11 = call i32 @putc(i32 %9, i32* %10)
%12 = load i32, i32* %4
%13 = ashr i32 %12, 16
%14 = load i32*, i32** %3
%15 = call i32 @putc(i32 %13, i32* %14)
%16 = load i32, i32* %4
%17 = ashr i32 %16, 24
%18 = load i32*, i32** %3
%19 = call i32 @putc(i32 %17, i32* %18)
ret i32 %19
}

LLVM IR (-O2):
define i32 @write_long(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @putc(i32 %1, i32* %0)
%4 = ashr i32 %1, 8
%5 = tail call i32 @putc(i32 %4, i32* %0)
%6 = ashr i32 %1, 16
%7 = tail call i32 @putc(i32 %6, i32* %0)
%8 = ashr i32 %1, 24
%9 = tail call i32 @putc(i32 %8, i32* %0)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_ext_device_manager_reorder_devices_for_role() {
  printf("NOT IMPLEMENTED:"
         "pa_ext_device_manager_reorder_devices_for_role"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [64 x i8] c"NOT IMPLEMENTED:pa_ext_device_manager_reorder_devices_for_role\0A\00"
define i32 @pa_ext_device_manager_reorder_devices_for_role() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [63 x i8] c"NOT IMPLEMENTED:pa_ext_device_manager_reorder_devices_for_role\00"
define i32 @pa_ext_device_manager_reorder_devices_for_role() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void gtk_tooltips_get_info_from_tip_window() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tooltips_get_info_from_tip_window() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ memset(char *, int, int);
int /*<<< orphan*/ stdout;
int main() {
  char *c;
  c = malloc(9 * sizeof(char));
  memset(c, 4, 9);
  fprintf(stdout, "conteudo: %s\n", c);
  free(c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x9,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
mov    $0x9,%edx
call   1040 <memset@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rdx
lea    0xe7c(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x9,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x4,%esi
mov    $0x9,%edx
call   1040 <memset@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
mov    %rbx,%rdx
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stdout = global i32 0
@.str = [14 x i8] c"conteudo: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
%3 = call i8* @malloc(i32 9)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memset(i8* %4, i32 4, i32 9)
%6 = load i32, i32* @stdout
%7 = load i8*, i8** %2
%8 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i8*, i8** %2
%10 = call i32 @free(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [14 x i8] c"conteudo: %s\0A\00"
define i32 @main() {
%1 = tail call dereferenceable_or_null(9) i8* @malloc(i32 9)
%2 = tail call i32 @memset(i8* %1, i32 4, i32 9)
%3 = load i32, i32* @stdout
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1)
%5 = tail call i32 @free(i8* %1)
ret i32 0
}
int mod(int a, int b) {
  int x = (a % b);
  return x < 0 ? x + b : x;
}


x86 assembly (clang, -O0):
<mod>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    112c <mod+0x2c>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1132 <mod+0x32>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mod>:
mov    %edi,%eax
cltd
idiv   %esi
mov    %edx,%eax
sar    $0x1f,%eax
and    %esi,%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @mod(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp slt i32 %3, 0
%5 = select i1 %4, i32 %1, i32 0
%6 = add nsw i32 %5, %3
ret i32 %6
}
void dump_float(void) {}


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int countMoviesRows(char filename[]) {
  int moviesRows;
  FILE *file;
  file = fopen(filename, "r");
  fscanf(file, "%d", &moviesRows);
  return moviesRows;
}


x86 assembly (clang, -O0):
<countMoviesRows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xeb7(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1030 <fscanf@plt>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countMoviesRows>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <fopen@plt>
lea    0xece(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    %rax,%rdi
call   1030 <fscanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @countMoviesRows(i8* nocapture %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
ret i32 %6
}