xunge/DecIR huggingface dataset:
double logic_or(double a, double b) { return a || b; }


x86 assembly (clang, -O0):
<logic_or>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x1,%al
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x11(%rbp)
jne    1142 <logic_or+0x42>
jp     1142 <logic_or+0x42>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
setne  %al
setp   %cl
or     %cl,%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<logic_or>:
xorpd  %xmm2,%xmm2
ucomisd %xmm2,%xmm0
setp   %al
setne  %cl
or     %al,%cl
ucomisd %xmm2,%xmm1
setp   %al
setne  %dl
or     %al,%dl
or     %cl,%dl
movzbl %dl,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @logic_or(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fcmp une double %5, 0.000000e+00
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load double, double* %4
%9 = fcmp une double %8, 0.000000e+00
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = sitofp i32 %12 to double
ret double %13
}

LLVM IR (-O2):
define double @logic_or(double %0, double %1) {
%3 = fcmp une double %0, 0.000000e+00
%4 = fcmp une double %1, 0.000000e+00
%5 = or i1 %3, %4
%6 = uitofp i1 %5 to double
ret double %6
}
/* Variables and functions */
char **x_malloc(int);
char **allocate_buffer(int lines_count) {
  char **lines = x_malloc(lines_count * sizeof(char *));
  for (int i = 0; i < lines_count; i++)
    lines[i] = NULL;
  return lines;
}


x86 assembly (clang, -O0):
<allocate_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <x_malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115f <allocate_buffer+0x4f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1135 <allocate_buffer+0x25>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<allocate_buffer>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,8),%edi
call   1040 <x_malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1149 <allocate_buffer+0x29>
mov    %ebx,%edx
shl    $0x3,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8** @allocate_buffer(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i8** @x_malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = bitcast i8** %3 to i8*
%7 = zext i32 %0 to i64
%8 = shl nuw nsw i64 %7, 3
br label %9
9: ; preds = %5, %1
ret i8** %3
}
void swap(int a[], int m, int n) {
  int t;
  t = a[m];
  a[m] = a[n];
  a[n] = t;
  return;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
/* Variables and functions */
scalar_t__ isupper(int);
char toupper(int);
void Uppercase(char *ch) { *ch = isupper((int)*ch) ? *ch : toupper((int)*ch); }


x86 assembly (clang, -O0):
<Uppercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1040 <isupper@plt>
cmp    $0x0,%rax
je     1151 <Uppercase+0x31>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    1163 <Uppercase+0x43>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Uppercase>:
push   %rbx
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1040 <isupper@plt>
mov    %rax,%rcx
mov    (%rbx),%al
test   %rcx,%rcx
jne    113e <Uppercase+0x1e>
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @Uppercase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = call i64 @isupper(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
br label %18
12: ; preds = %1
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = call signext i8 @toupper(i32 %15)
%17 = sext i8 %16 to i32
br label %18
18: ; preds = %12, %8
%19 = phi i32 [ %11, %8 ], [ %17, %12 ]
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %2
store i8 %20, i8* %21
ret void
}

LLVM IR (-O2):
define void @Uppercase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = tail call i64 @isupper(i32 %3)
%5 = icmp eq i64 %4, 0
%6 = load i8, i8* %0
br i1 %5, label %7, label %10
7: ; preds = %1
%8 = sext i8 %6 to i32
%9 = tail call signext i8 @toupper(i32 %8)
br label %10
10: ; preds = %1, %7
%11 = phi i8 [ %9, %7 ], [ %6, %1 ]
store i8 %11, i8* %0
ret void
}
/* Variables and functions */
int backup_senser_sync_msg(int, int /*<<< orphan*/, char *, size_t *, int,
                           char);
int backup_senser_cmd_ID1(char set_value, char *get_value) {
  size_t len = sizeof(char);
  return backup_senser_sync_msg(15, 0, get_value, &len, 1, set_value);
}


x86 assembly (clang, -O0):
<backup_senser_cmd_ID1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0xf,%edi
xor    %esi,%esi
lea    -0x18(%rbp),%rcx
mov    $0x1,%r8d
movsbl -0x1(%rbp),%r9d
call   1030 <backup_senser_sync_msg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<backup_senser_cmd_ID1>:
push   %rax
mov    %rsi,%rdx
mov    %edi,%r9d
movq   $0x1,(%rsp)
mov    %rsp,%rcx
mov    $0xf,%edi
xor    %esi,%esi
mov    $0x1,%r8d
call   1030 <backup_senser_sync_msg@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @backup_senser_cmd_ID1(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i64
store i8 %0, i8* %3
store i8* %1, i8** %4
store i64 1, i64* %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %3
%8 = call i32 @backup_senser_sync_msg(i32 15, i32 0, i8* %6, i64* %5, i32 1, i8 signext %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @backup_senser_cmd_ID1(i8 signext %0, i8* %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
store i64 1, i64* %3
%5 = call i32 @backup_senser_sync_msg(i32 15, i32 0, i8* %1, i64* %3, i32 1, i8 signext %0)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ LoiterCommandHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void LoiterCommandRequestUpdate() {
  UAVObjRequestUpdate(LoiterCommandHandle());
}


x86 assembly (clang, -O0):
<LoiterCommandRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <LoiterCommandHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LoiterCommandRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <LoiterCommandHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @LoiterCommandRequestUpdate() {
%1 = call i32 (...) @LoiterCommandHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @LoiterCommandRequestUpdate() {
%1 = tail call i32 (...) @LoiterCommandHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
int XContextualDrawing() {}


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

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

LLVM IR (-O0):
define i32 @XContextualDrawing() {
%1 = alloca i32
%2 = load i32, i32* %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @XContextualDrawing() {
ret i32 undef
}
/* Variables and functions */
unsigned char inb(int);
int /*<<< orphan*/ outb(unsigned short, int);
unsigned char read_crtc_b(unsigned short addr) {
  outb(addr, 0x3D4);
  return inb(0x3D5);
}


x86 assembly (clang, -O0):
<read_crtc_b>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    $0x3d4,%esi
movzwl -0x2(%rbp),%edi
call   1030 <outb@plt>
mov    $0x3d5,%edi
call   1040 <inb@plt>
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_crtc_b>:
push   %rax
mov    $0x3d4,%esi
call   1030 <outb@plt>
mov    $0x3d5,%edi
pop    %rax
jmp    1040 <inb@plt>

LLVM IR (-O0):
define zeroext i8 @read_crtc_b(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i32 @outb(i16 zeroext %3, i32 980)
%5 = call zeroext i8 @inb(i32 981)
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @read_crtc_b(i16 zeroext %0) {
%2 = tail call i32 @outb(i16 zeroext %0, i32 980)
%3 = tail call zeroext i8 @inb(i32 981)
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_char(char, char);
void print_str(char *str, char attr) {
  int i = 0;
  while (str[i])
    print_char(str[i++], attr);
}


x86 assembly (clang, -O0):
<print_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     1161 <print_str+0x51>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
movsbl %al,%edi
movsbl -0x9(%rbp),%esi
call   1030 <print_char@plt>
jmp    1129 <print_str+0x19>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_str>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     1145 <print_str+0x35>
mov    %rdi,%rbx
add    $0x1,%rbx
movsbl %sil,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <print_char@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <print_str+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @print_str(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %8, %5 ], [ 0, %2 ]
%7 = phi i8 [ %11, %5 ], [ %3, %2 ]
%8 = add nuw i64 %6, 1
%9 = tail call i32 @print_char(i8 signext %7, i8 signext %1)
%10 = getelementptr inbounds i8, i8* %0, i64 %8
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exibeMenuAnt(int);
int /*<<< orphan*/ printf(char *);
void menu1(int at) {
  exibeMenuAnt(at);
  printf("ATUAL: 1\n");
}


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

x86 assembly (clang, -O2):
<menu1>:
push   %rax
call   1040 <exibeMenuAnt@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [9 x i8] c"ATUAL: 1\00"
define void @menu1(i32 %0) {
%2 = tail call i32 @exibeMenuAnt(i32 %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closelog();
int /*<<< orphan*/ report(char *, int /*<<< orphan*/);
void exit_handler(void) {
  report("daemon exiting.", 0);
  closelog();
}


x86 assembly (clang, -O0):
<exit_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
xor    %esi,%esi
call   1040 <report@plt>
mov    $0x0,%al
call   1030 <closelog@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<exit_handler>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %esi,%esi
call   1040 <report@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <closelog@plt>

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

LLVM IR (-O2):
@.str = [16 x i8] c"daemon exiting.\00"
define void @exit_handler() {
%1 = tail call i32 @report(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 (...) @closelog()
ret void
}
/* Variables and functions */
int O_DSYNC;
int unix_fcntl_o_dsync() { return O_DSYNC; }


x86 assembly (clang, -O0):
<unix_fcntl_o_dsync>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ed5(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<unix_fcntl_o_dsync>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@O_DSYNC = global i32 0
define i32 @unix_fcntl_o_dsync() {
%1 = load i32, i32* @O_DSYNC
ret i32 %1
}

LLVM IR (-O2):
@O_DSYNC = global i32 0
define i32 @unix_fcntl_o_dsync() {
%1 = load i32, i32* @O_DSYNC
ret i32 %1
}
unsigned xrop3_132_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ T;
  stk2 = ~stk2;
  stk1 = S & stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


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

x86 assembly (clang, -O2):
<xrop3_132_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    %esi,%eax
xor    $0xff00,%eax
and    %ecx,%eax
xor    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_132_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, 65280
%8 = and i32 %7, %4
%9 = xor i32 %4, -1
%10 = and i32 %9, %5
%11 = or i32 %8, %10
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ error(int, int /*<<< orphan*/, int /*<<< orphan*/, char *);
void terminal_lhs(int lineno) {
  error(lineno, 0, 0, "a token appears on the lhs of a production");
}


x86 assembly (clang, -O0):
<terminal_lhs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
xor    %edx,%edx
lea    0xed9(%rip),%rcx
mov    %edx,%esi
call   1030 <error@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<terminal_lhs>:
lea    0xee9(%rip),%rcx
xor    %esi,%esi
xor    %edx,%edx
jmp    1030 <error@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"a token appears on the lhs of a production\00"
define void @terminal_lhs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @error(i32 %3, i32 0, i32 0, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"a token appears on the lhs of a production\00"
define void @terminal_lhs(i32 %0) {
%2 = tail call i32 @error(i32 %0, i32 0, i32 0, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  for (int i = 8000; i > 0; i--) {
    printf("%d \n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1f40,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    114d <main+0x3d>
mov    -0x8(%rbp),%esi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0x1f41,%ebx
lea    0xee0(%rip),%r14
add    $0xffffffff,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x1,%ebx
ja     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%d \0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i32 [ 8000, %0 ], [ %5, %2 ]
%4 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = add nsw i32 %3, -1
%6 = icmp ugt i32 %3, 1
br i1 %6, label %2, label %1
}
void gdk_window_state_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_window_state_get_type() {
ret void
}
void foo(void) {
  unsigned int a[2];
  unsigned int b[2];
  unsigned int c[2];
  unsigned int d[2];
#pragma acc kernels copyin(a) create(b) copyout(c) copy(d)
  {
    a[0] = 0;
    b[0] = 0;
    c[0] = 0;
    d[0] = 0;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @foo() {
%1 = alloca [2 x i32]
%2 = alloca [2 x i32]
%3 = alloca [2 x i32]
%4 = alloca [2 x i32]
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
store i32 0, i32* %5
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %2, i64 0, i64 0
store i32 0, i32* %6
%7 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 0, i32* %7
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
store i32 0, i32* %8
ret void
}

LLVM IR (-O2):
define void @foo() {
ret void
}
/* Variables and functions */
short h_mod(short *, short *);
short intr_wrap_385(short p1, short p2) { return h_mod(&p1, &p2); }


x86 assembly (clang, -O0):
<intr_wrap_385>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
lea    -0x2(%rbp),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <h_mod@plt>
cwtl
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intr_wrap_385>:
push   %rax
mov    %di,0x6(%rsp)
mov    %si,0x4(%rsp)
lea    0x6(%rsp),%rdi
lea    0x4(%rsp),%rsi
call   1030 <h_mod@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i16 @intr_wrap_385(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @h_mod(i16* %3, i16* %4)
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @intr_wrap_385(i16 signext %0, i16 signext %1) {
%3 = alloca i16
%4 = alloca i16
store i16 %0, i16* %3
store i16 %1, i16* %4
%5 = call signext i16 @h_mod(i16* %3, i16* %4)
ret i16 %5
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *strdupl(char *s) {
  char *p;
  p = malloc(strlen(s) + 1);
  if (p != NULL)
    strcpy(p, s);
  return p;
}


x86 assembly (clang, -O0):
<strdupl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116d <strdupl+0x3d>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdupl>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1158 <strdupl+0x28>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @strdupl(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @malloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %2
%13 = call i32 @strcpy(i8* %11, i8* %12)
br label %14
14: ; preds = %10, %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
define i8* @strdupl(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %6, %1
ret i8* %4
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t from_bcd(uint8_t n) { return (n >> 4) * 10 + (n & 15); }


x86 assembly (clang, -O0):
<from_bcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x4,%eax
imul   $0xa,%eax,%eax
mov    -0x4(%rbp),%ecx
and    $0xf,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<from_bcd>:
mov    %edi,%eax
sar    $0x4,%eax
lea    (%rax,%rax,4),%eax
and    $0xf,%edi
lea    (%rdi,%rax,2),%eax
ret

LLVM IR (-O0):
define i32 @from_bcd(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 4
%5 = mul nsw i32 %4, 10
%6 = load i32, i32* %2
%7 = and i32 %6, 15
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @from_bcd(i32 %0) {
%2 = ashr i32 %0, 4
%3 = mul nsw i32 %2, 10
%4 = and i32 %0, 15
%5 = add nsw i32 %3, %4
ret i32 %5
}
/* Variables and functions */
int add2(int);
int main(int argc, char **argv) { return add2(argc); }


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

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

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @add2(i32 %0)
ret i32 %3
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  unsigned long serial;
};
struct TYPE_4__ {
  TYPE_1__ xgraphicsexpose;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xgraphicsexpose_serial(void *_p, unsigned long _v) {
  ((XEvent *)_p)->xgraphicsexpose.serial = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define void @set_XEvent_xgraphicsexpose_serial(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i64 %5, i64* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xgraphicsexpose_serial(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perfRun(int);
int main() {
  for (int i = 0; i < 5; i++) {
    perfRun(i);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <perfRun@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <perfRun@plt>
mov    $0x1,%edi
call   1030 <perfRun@plt>
mov    $0x2,%edi
call   1030 <perfRun@plt>
mov    $0x3,%edi
call   1030 <perfRun@plt>
mov    $0x4,%edi
call   1030 <perfRun@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 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 5
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @perfRun(i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @perfRun(i32 0)
%2 = tail call i32 @perfRun(i32 1)
%3 = tail call i32 @perfRun(i32 2)
%4 = tail call i32 @perfRun(i32 3)
%5 = tail call i32 @perfRun(i32 4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ C();
void B(void) { C(); }


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

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

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

LLVM IR (-O2):
define void @B() {
%1 = tail call i32 (...) @C()
ret void
}
void TimerStart(unsigned long ulBase) {

  ;
  (*((volatile unsigned long *)(ulBase + 0x00000000))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<TimerStart>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerStart>:
orq    $0x1,(%rdi)
ret

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

LLVM IR (-O2):
define void @TimerStart(i64 %0) {
%2 = inttoptr i64 %0 to i64*
%3 = load volatile i64, i64* %2
%4 = or i64 %3, 1
store volatile i64 %4, i64* %2
ret void
}
int get_long_size() {
  unsigned long c = ~0;
  int i = 0;
  do {
    ++i;
    c ^= 1;
    c >>= 1;
  } while (c);
  return i;
}


x86 assembly (clang, -O0):
<get_long_size>:
push   %rbp
mov    %rsp,%rbp
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
xor    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1113 <get_long_size+0x13>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_long_size() {
ret i32 64
}
/* Variables and functions */
int /*<<< orphan*/ hash_print();
void cmd_hashprobe(void) { hash_print(); }


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

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

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

LLVM IR (-O2):
define void @cmd_hashprobe() {
%1 = tail call i32 (...) @hash_print()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ USED(char *, long, int);
int floppyexec(char *a, long b, int c) {
  USED(a, b, c);
  return b;
}


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

x86 assembly (clang, -O2):
<floppyexec>:
push   %rbx
mov    %rsi,%rbx
call   1030 <USED@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @floppyexec(i8* %0, i64 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32, i32* %6
%10 = call i32 @USED(i8* %7, i64 %8, i32 %9)
%11 = load i64, i64* %5
%12 = trunc i64 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @floppyexec(i8* %0, i64 %1, i32 %2) {
%4 = tail call i32 @USED(i8* %0, i64 %1, i32 %2)
%5 = trunc i64 %1 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ beep();
void display_beep() { beep(); }


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

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

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

LLVM IR (-O2):
define void @display_beep() {
%1 = tail call i32 (...) @beep()
ret void
}
/* Variables and functions */
int smi_write(unsigned short, unsigned short, unsigned short);
int smi_port_write(unsigned short phyaddr, unsigned short regnum,
                   unsigned short regvalue) {
  return smi_write(phyaddr, regnum, regvalue);
}


x86 assembly (clang, -O0):
<smi_port_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dx,%ax
mov    %si,%cx
mov    %di,%dx
mov    %dx,-0x2(%rbp)
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x2(%rbp),%cx
mov    -0x4(%rbp),%ax
movzwl %cx,%edi
movzwl %ax,%esi
movzwl -0x6(%rbp),%edx
call   1030 <smi_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @smi_port_write(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16 %2, i16* %6
%7 = load i16, i16* %4
%8 = load i16, i16* %5
%9 = load i16, i16* %6
%10 = call i32 @smi_write(i16 zeroext %7, i16 zeroext %8, i16 zeroext %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @smi_port_write(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2) {
%4 = tail call i32 @smi_write(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2)
ret i32 %4
}
double neg(double z) { return (-z); }


x86 assembly (clang, -O0):
<neg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
pop    %rbp
ret

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

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

LLVM IR (-O2):
define double @neg(double %0) {
%2 = fneg double %0
ret double %2
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ y;
};
struct TYPE_4__ {
  TYPE_1__ max_aspect;
};
typedef TYPE_2__ XSizeHints;

/* Variables and functions */
int get_XSizeHints_max_aspect_y(void *_p) {
  return (int)((XSizeHints *)_p)->max_aspect.y;
}


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

x86 assembly (clang, -O2):
<get_XSizeHints_max_aspect_y>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XSizeHints_max_aspect_y(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XSizeHints_max_aspect_y(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *getcwd(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int printCWD() {
  char *dir = getcwd(NULL, 0);
  printf("%s\n", dir);
  free(dir);
  return 0;
}


x86 assembly (clang, -O0):
<printCWD>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1050 <getcwd@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printCWD>:
push   %rbx
xor    %edi,%edi
xor    %esi,%esi
call   1050 <getcwd@plt>
mov    %rax,%rbx
lea    0xebc(%rip),%rdi
mov    %rax,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @printCWD() {
%1 = tail call i8* @getcwd(i32* null, i32 0)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%3 = tail call i32 @free(i8* %1)
ret i32 0
}
int isxdigit(int c) {
  switch (c) {
  case '0':
  case '1':
  case '2':
  case '3':
  case '4':
  case '5':
  case '6':
  case '7':
  case '8':
  case '9':
  case 'a':
  case 'b':
  case 'c':
  case 'd':
  case 'e':
  case 'f':
  case 'A':
  case 'B':
  case 'C':
  case 'D':
  case 'E':
  case 'F':
    return 1;
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffd0,%eax
sub    $0xa,%eax
jb     1146 <isxdigit+0x46>
jmp    111e <isxdigit+0x1e>
mov    -0xc(%rbp),%eax
add    $0xffffffbf,%eax
sub    $0x6,%eax
jb     1146 <isxdigit+0x46>
jmp    1132 <isxdigit+0x32>
mov    -0xc(%rbp),%eax
add    $0xffffff9f,%eax
sub    $0x5,%eax
ja     1152 <isxdigit+0x52>
jmp    1146 <isxdigit+0x46>
movl   $0x1,-0x4(%rbp)
jmp    1159 <isxdigit+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0x36,%edi
ja     1117 <isxdigit+0x17>
movslq %edi,%rax
lea    0xeec(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %6 [
i32 48, label %5
i32 49, label %5
i32 50, label %5
i32 51, label %5
i32 52, label %5
i32 53, label %5
i32 54, label %5
i32 55, label %5
i32 56, label %5
i32 57, label %5
i32 97, label %5
i32 98, label %5
i32 99, label %5
i32 100, label %5
i32 101, label %5
i32 102, label %5
i32 65, label %5
i32 66, label %5
i32 67, label %5
i32 68, label %5
i32 69, label %5
i32 70, label %5
]
5: ; preds = %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1, %1
store i32 1, i32* %2
br label %7
6: ; preds = %1
store i32 0, i32* %2
br label %7
7: ; preds = %6, %5
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@switch.table.isxdigit = [55 x i32] [i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1]
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 55
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [55 x i32], [55 x i32]* @switch.table.isxdigit, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ 0, %1 ]
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ what;
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, int /*<<< orphan*/ *, int);
void put64(char *where, uint64_t what) { memcpy(where, &what, sizeof(what)); }


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

x86 assembly (clang, -O2):
<put64>:
push   %rax
mov    %esi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @put64(i8* %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @memcpy(i8* %0, i32* %3, i32 4)
ret void
}
void delayacct_blkio_start(void) {}


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

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

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

LLVM IR (-O2):
define void @delayacct_blkio_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ unlink(char *);
void HANDLER(char *path, char *name) {
  (void)name;
  unlink(path);
}


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

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

LLVM IR (-O0):
define void @HANDLER(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 = load i8*, i8** %3
%7 = call i32 @unlink(i8* %6)
ret void
}

LLVM IR (-O2):
define void @HANDLER(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = tail call i32 @unlink(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, size_t);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *xmalloc(size_t size) {
  void *p = malloc(size);
  if (!p) {
    fprintf(stderr, "error: xmalloc(%zu) - ran out of memory!\n", size);
    exit(EXIT_FAILURE);
  }
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    117b <xmalloc+0x4b>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xe98(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e64(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1040 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"error: xmalloc(%zu) - ran out of memory!\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %14, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = load i64, i64* %2
%11 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %10)
%12 = load i32, i32* @EXIT_FAILURE
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %1
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"error: xmalloc(%zu) - ran out of memory!\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %0)
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %1
ret i8* %2
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long time;
};
typedef TYPE_1__ XPropertyEvent;

/* Variables and functions */
void set_XPropertyEvent_time(void *_p, unsigned long _v) {
  ((XPropertyEvent *)_p)->time = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XPropertyEvent_time(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XPropertyEvent_time(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}