xunge/DecIR huggingface dataset:
int name_terminated(const char ch, const char term) {
  if (term == 0) {
    return (ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r');
  } else {
    return (ch == term);
  }
}


x86 assembly (clang, -O0):
<name_terminated>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x6(%rbp),%eax
cmp    $0x0,%eax
jne    1170 <name_terminated+0x70>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x7(%rbp)
je     1160 <name_terminated+0x60>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x7(%rbp)
je     1160 <name_terminated+0x60>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x7(%rbp)
je     1160 <name_terminated+0x60>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
sete   %al
mov    %al,-0x7(%rbp)
mov    -0x7(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <name_terminated+0x85>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<name_terminated>:
test   %sil,%sil
je     110f <name_terminated+0xf>
xor    %eax,%eax
cmp    %sil,%dil
sete   %al
jmp    112e <name_terminated+0x2e>
cmp    $0x20,%dil
ja     112f <name_terminated+0x2f>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002600,%rdx
bt     %rcx,%rdx
jae    112f <name_terminated+0x2f>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @name_terminated(i8 signext %0, i8 signext %1) {
%3 = icmp eq i8 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
switch i8 %0, label %5 [
i8 32, label %9
i8 10, label %9
i8 9, label %9
i8 13, label %9
]
5: ; preds = %4
br label %9
6: ; preds = %2
%7 = icmp eq i8 %0, %1
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %5, %4, %4, %4, %6
%10 = phi i32 [ %8, %6 ], [ 1, %4 ], [ 0, %5 ], [ 1, %4 ], [ 1, %4 ], [ 1, %4 ]
ret i32 %10
}
int ishex(char c) {
  return ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') ||
          (c >= 'A' && c <= 'F'));
}


x86 assembly (clang, -O0):
<ishex>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <ishex+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    116d <ishex+0x6d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1148 <ishex+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x66,%ecx
mov    %al,-0x2(%rbp)
jle    116d <ishex+0x6d>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1167 <ishex+0x67>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishex>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
and    $0xdf,%dil
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @ishex(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = and i8 %0, -33
%5 = add i8 %4, -65
%6 = icmp ult i8 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void (*tag2(sig, handler))() int sig;
void (*handler)();
{
  (*handler)(sig);
  return handler;
}


x86 assembly (clang, -O0):
<tag2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   *%rcx
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tag2>:
push   %rbx
mov    %rsi,%rbx
xor    %eax,%eax
call   *%rsi
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define void (...)* @tag2(i32 %0, void (...)* returned %1) {
%3 = bitcast void (...)* %1 to void (i32, ...)*
tail call void (i32, ...) %3(i32 %0)
ret void (...)* %1
}
/* Variables and functions */
int **subsets(int *, int, int **, int *);
int main(void) {
  int **res, *col, n;
  int x[] = {1, 2, 3};
  res = subsets(x, 3, &col, &n);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x20(%rbp)
lea    -0x28(%rbp),%rdi
mov    $0x3,%esi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1030 <subsets@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x8(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,(%rsp)
mov    %rsp,%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    $0x3,%esi
call   1030 <subsets@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32**
%3 = alloca i32*
%4 = alloca i32
%5 = alloca [3 x i32]
store i32 0, i32* %1
%6 = bitcast [3 x i32]* %5 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%8 = call i32** @subsets(i32* %7, i32 3, i32** %3, i32* %4)
store i32** %8, i32*** %2
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [3 x i32] [i32 1, i32 2, i32 3]
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca [3 x i32]
%4 = bitcast i32** %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast [3 x i32]* %3 to i8*
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%8 = call i32** @subsets(i32* %7, i32 3, i32** %1, i32* %2)
ret i32 0
}
double millimetresToKm(double millimetres) { return millimetres / 1000000.0; }


x86 assembly (clang, -O0):
<millimetresToKm>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<millimetresToKm>:
divsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @millimetresToKm(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fdiv double %3, 1.000000e+06
ret double %4
}

LLVM IR (-O2):
define double @millimetresToKm(double %0) {
%2 = fdiv double %0, 1.000000e+06
ret double %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ merge(int, int /*<<< orphan*/ *, int);
void sort(int n, uint32_t x[n]) {
  if (n <= 1)
    return;
  sort(n / 2, x);
  sort(n / 2, x + n / 2);
  merge(n / 2, x, 1);
}


x86 assembly (clang, -O0):
<sort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jg     113e <sort+0x1e>
jmp    1199 <sort+0x79>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1030 <sort@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cltq
shl    $0x2,%rax
add    %rax,%rsi
call   1030 <sort@plt>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1040 <merge@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
cmp    $0x1,%edi
jg     1126 <sort+0x6>
ret
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
shr    %ebx
mov    %ebx,%edi
call   1030 <sort@plt>
lea    (%r14,%rbx,4),%rsi
mov    %ebx,%edi
call   1030 <sort@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <merge@plt>

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

LLVM IR (-O2):
define void @sort(i32 %0, i32* %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %5
4: ; preds = %2, %5
ret void
5: ; preds = %2
%6 = lshr i32 %0, 1
tail call void @sort(i32 %6, i32* %1)
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %1, i64 %7
tail call void @sort(i32 %6, i32* %8)
%9 = tail call i32 @merge(i32 %6, i32* %1, i32 1)
br label %4
}
void Wakeup_Interrupt_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @Wakeup_Interrupt_Interrupt() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ start_stop_trace(char);
void start_trace(void) { start_stop_trace('1'); }


x86 assembly (clang, -O0):
<start_trace>:
push   %rbp
mov    %rsp,%rbp
mov    $0x31,%edi
call   1030 <start_stop_trace@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_trace>:
mov    $0x31,%edi
jmp    1030 <start_stop_trace@plt>

LLVM IR (-O0):
define void @start_trace() {
%1 = call i32 @start_stop_trace(i8 signext 49)
ret void
}

LLVM IR (-O2):
define void @start_trace() {
%1 = tail call i32 @start_stop_trace(i8 signext 49)
ret void
}
void gtk_button_get_image() {}


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

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

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

LLVM IR (-O2):
define void @gtk_button_get_image() {
ret void
}
int get_int32(char *start) {
  int value = 0;
  value = (int)((unsigned char)*start) | (((unsigned char)*(start + 1)) << 8) |
          (((unsigned char)*(start + 2)) << 16) |
          (((unsigned char)*(start + 3)) << 24);
  return value;
}


x86 assembly (clang, -O0):
<get_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x2(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @get_int32(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = shl nuw nsw i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
void XtReservePropertyAtom() {}


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

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

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

LLVM IR (-O2):
define void @XtReservePropertyAtom() {
ret void
}
void _Z7shsInitP8SHS_INFO(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z7shsInitP8SHS_INFO() {
ret void
}
void DBGFR3InfoRegisterExternal(void) {}


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

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

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

LLVM IR (-O2):
define void @DBGFR3InfoRegisterExternal() {
ret void
}
void RTAvlUIntPtrGetBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlUIntPtrGetBestFit() {
ret void
}
void pinconf_free_setting(const struct pinctrl_setting *setting) {}


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

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

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

LLVM IR (-O2):
%struct.pinctrl_setting = type opaque
define void @pinconf_free_setting(%struct.pinctrl_setting* nocapture %0) {
ret void
}
int gcd(int a, int b) {
  int r;
  do {
    r = a % b;
    a = b;
    b = r;
  } while (r != 0);
  return a;
}


x86 assembly (clang, -O0):
<gcd>:
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)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    110a <gcd+0xa>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%eax
mov    %edx,%edi
cltd
idiv   %edi
test   %edx,%edx
jne    1110 <gcd+0x10>
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @gcd(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i32 [ %1, %2 ], [ %6, %3 ]
%5 = phi i32 [ %0, %2 ], [ %4, %3 ]
%6 = srem i32 %5, %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %3
8: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ Console_Int(long long, long long);
void OPM_LogWNum(long long i, long long len) { Console_Int(i, len); }


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

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

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

LLVM IR (-O2):
define void @OPM_LogWNum(i64 %0, i64 %1) {
%3 = tail call i32 @Console_Int(i64 %0, i64 %1)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int compare(const void *a, const void *b) {
  return strcmp(*((char **)a), *((char **)b));
}


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

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

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

LLVM IR (-O2):
define i32 @compare(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
unsigned char ExtractYear(uint16_t date) { return date & 0x7F; }


x86 assembly (clang, -O0):
<ExtractYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExtractYear>:
mov    %edi,%eax
and    $0x7f,%al
ret

LLVM IR (-O0):
define zeroext i8 @ExtractYear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 127
%5 = trunc i32 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define zeroext i8 @ExtractYear(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = and i8 %2, 127
ret i8 %3
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t av_gcd(int64_t a, int64_t b) {
  if (b)
    return av_gcd(b, a % b);
  else
    return a;
}


x86 assembly (clang, -O0):
<av_gcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1141 <av_gcd+0x31>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%esi
call   1030 <av_gcd@plt>
mov    %eax,-0x4(%rbp)
jmp    1147 <av_gcd+0x37>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_gcd>:
mov    %edi,%eax
test   %esi,%esi
je     111d <av_gcd+0x1d>
mov    %esi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jne    1110 <av_gcd+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @av_gcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %1, %2 ]
%6 = phi i32 [ %5, %4 ], [ %0, %2 ]
%7 = srem i32 %6, %5
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i32 [ %0, %2 ], [ %5, %4 ]
ret i32 %10
}
int __tolower(int c) {
  if (c >= 'A' && c <= 'Z') {
    c = c + ('a' - 'A');
  }
  return c;
}


x86 assembly (clang, -O0):
<__tolower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1124 <__tolower+0x24>
cmpl   $0x5a,-0x4(%rbp)
jg     1124 <__tolower+0x24>
mov    -0x4(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__tolower>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @__tolower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %11
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = load i32, i32* %2
%10 = add nsw i32 %9, 32
store i32 %10, i32* %2
br label %11
11: ; preds = %8, %5, %1
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @__tolower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
int errno;
int check_multiple_of_ten(int v) {
  int r = v % 10;
  if (r == 0) {
    return 0;
  } else {
    errno = r;
    return -1;
  }
}


x86 assembly (clang, -O0):
<check_multiple_of_ten>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    112b <check_multiple_of_ten+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    113e <check_multiple_of_ten+0x3e>
mov    -0xc(%rbp),%ecx
mov    0x2eab(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_multiple_of_ten>:
movslq %edi,%rax
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
je     112f <check_multiple_of_ten+0x2f>
mov    0x2eb9(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
@errno = global i32 0
define i32 @check_multiple_of_ten(i32 %0) {
%2 = srem i32 %0, 10
%3 = icmp eq i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %1
store i32 %2, i32* @errno
br label %5
5: ; preds = %1, %4
%6 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ lcm(long *, int);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
long main() {
  long o[] = {1,  2,  3,  4,  5,  6,  7,  8,  9,  10,
              11, 12, 13, 14, 15, 16, 17, 18, 19, 20};
  printf("%lu", lcm(o, 20));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
lea    -0xa0(%rbp),%rdi
lea    0xeb7(%rip),%rsi
mov    $0xa0,%edx
call   1050 <memcpy@plt>
lea    -0xa0(%rbp),%rdi
mov    $0x14,%esi
call   1040 <lcm@plt>
mov    %eax,%esi
lea    0xf33(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xa0,%rsp
lea    0xec1(%rip),%rsi
mov    %rsp,%rbx
mov    $0xa0,%edx
mov    %rbx,%rdi
call   1050 <memcpy@plt>
mov    %rbx,%rdi
mov    $0x14,%esi
call   1040 <lcm@plt>
lea    0xf3d(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.o = [20 x i64] [i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15, i64 16, i64 17, i64 18, i64 19, i64 20]
@.str = [4 x i8] c"%lu\00"
define i64 @main() {
%1 = alloca [20 x i64]
%2 = bitcast [20 x i64]* %1 to i8*
%3 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 0
%4 = call i32 @lcm(i64* %3, i32 20)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i64 0
}

LLVM IR (-O2):
@__const.main.o = [20 x i64] [i64 1, i64 2, i64 3, i64 4, i64 5, i64 6, i64 7, i64 8, i64 9, i64 10, i64 11, i64 12, i64 13, i64 14, i64 15, i64 16, i64 17, i64 18, i64 19, i64 20]
@.str = [4 x i8] c"%lu\00"
define i64 @main() {
%1 = alloca [20 x i64]
%2 = bitcast [20 x i64]* %1 to i8*
%3 = getelementptr inbounds [20 x i64], [20 x i64]* %1, i64 0, i64 0
%4 = call i32 @lcm(i64* %3, i32 20)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long);
scalar_t__ pthread_self();
void *Sample_Priority(void *p) {
  ("Thread Sample_Priority is running\n");
  printf("I am a new thread #%08lx\n", (long)pthread_self());
  return NULL;
}


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

x86 assembly (clang, -O2):
<Sample_Priority>:
push   %rax
xor    %eax,%eax
call   1040 <pthread_self@plt>
lea    0xed1(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Thread Sample_Priority is running\0A\00"
@.str.1 = [26 x i8] c"I am a new thread #%08lx\0A\00"
define i8* @Sample_Priority(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i64 (...) @pthread_self()
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i64 %3)
ret i8* null
}

LLVM IR (-O2):
@.str.1 = [26 x i8] c"I am a new thread #%08lx\0A\00"
define noalias i8* @Sample_Priority(i8* nocapture readnone %0) {
%2 = tail call i64 (...) @pthread_self()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i64 %2)
ret i8* null
}
float dfn_rf(void) { return 6; }


x86 assembly (clang, -O0):
<dfn_rf>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dfn_rf>:
movss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @dfn_rf() {
ret float 6.000000e+00
}

LLVM IR (-O2):
define float @dfn_rf() {
ret float 6.000000e+00
}
/* Variables and functions */
double pow(int, unsigned int);
double utils_roundd(double x, unsigned int digits) {
  int val;
  double p = pow(10, digits);
  x = x * p;
  val = (x >= 0) ? (int)(x + 0.5) : (int)(x - 0.5);
  return val * 1.0 / p;
}


x86 assembly (clang, -O0):
<utils_roundd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0xa,%edi
call   1030 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     116c <utils_roundd+0x5c>
movsd  0xea5(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
jmp    1184 <utils_roundd+0x74>
movsd  -0x8(%rbp),%xmm0
movsd  0xe87(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x10(%rbp)
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xe71(%rip),%xmm1
mulsd  %xmm1,%xmm0
divsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_roundd>:
sub    $0x18,%rsp
mov    %edi,%esi
movapd %xmm0,(%rsp)
mov    $0xa,%edi
call   1030 <pow@plt>
movapd (%rsp),%xmm2
mulsd  %xmm0,%xmm2
xorpd  %xmm1,%xmm1
xor    %eax,%eax
ucomisd %xmm1,%xmm2
setb   %al
lea    0xebe(%rip),%rcx
addsd  (%rcx,%rax,8),%xmm2
cvttpd2dq %xmm2,%xmm1
cvtdq2pd %xmm1,%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @utils_roundd(double %0, i32 %1) {
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store double %0, double* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = call double @pow(i32 10, i32 %7)
store double %8, double* %6
%9 = load double, double* %3
%10 = load double, double* %6
%11 = fmul double %9, %10
store double %11, double* %3
%12 = load double, double* %3
%13 = fcmp oge double %12, 0.000000e+00
br i1 %13, label %14, label %18
14: ; preds = %2
%15 = load double, double* %3
%16 = fadd double %15, 5.000000e-01
%17 = fptosi double %16 to i32
br label %22
18: ; preds = %2
%19 = load double, double* %3
%20 = fsub double %19, 5.000000e-01
%21 = fptosi double %20 to i32
br label %22
22: ; preds = %18, %14
%23 = phi i32 [ %17, %14 ], [ %21, %18 ]
store i32 %23, i32* %5
%24 = load i32, i32* %5
%25 = sitofp i32 %24 to double
%26 = fmul double %25, 1.000000e+00
%27 = load double, double* %6
%28 = fdiv double %26, %27
ret double %28
}

LLVM IR (-O2):
define double @utils_roundd(double %0, i32 %1) {
%3 = tail call double @pow(i32 10, i32 %1)
%4 = fmul double %3, %0
%5 = fcmp ult double %4, 0.000000e+00
%6 = select i1 %5, double -5.000000e-01, double 5.000000e-01
%7 = fadd double %4, %6
%8 = fptosi double %7 to i32
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, %3
ret double %10
}
extern __attribute__((gnu_)) int isprint(int __c) {
  return (__c >= 0x20 && __c <= 0x7e);
}


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isprint+0x20>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 32
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct itimerspec {
  int dummy;
};

/* Variables and functions */
int syscall(int, int, struct itimerspec *);
int timerfd_gettime(int ufc, struct itimerspec *otmr) {
  return syscall(287, ufc, otmr);
}


x86 assembly (clang, -O0):
<timerfd_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x11f,%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timerfd_gettime>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x11f,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
%struct.itimerspec = type { i32 }
define i32 @timerfd_gettime(i32 %0, %struct.itimerspec* %1) {
%3 = tail call i32 @syscall(i32 287, i32 %0, %struct.itimerspec* %1)
ret i32 %3
}
void _alignment() { printf("Exception: %s\n", __FUNCTION__); }


x86 assembly (clang, -O0):
<_alignment>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
lea    0xeed(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_alignment>:
lea    0xee9(%rip),%rdi
lea    0xef1(%rip),%rsi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._alignment = [11 x i8] c"_alignment\00"
define void @_alignment() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__._alignment, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Exception: %s\0A\00"
@__FUNCTION__._alignment = [11 x i8] c"_alignment\00"
define void @_alignment() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__._alignment, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *longestPalindrome(char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char *s = "aabbaabbcc";
  printf("longestPalindrome = %s\n", longestPalindrome(s));
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [11 x i8] c"aabbaabbcc\00"
@.str.1 = [24 x i8] c"longestPalindrome = %s\0A\00"
define i32 @main() {
%1 = tail call i8* @longestPalindrome(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %1)
ret i32 0
}
void DeviceBoxRefocus() { return; }


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

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

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

LLVM IR (-O2):
define void @DeviceBoxRefocus() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ puts(char *);
void ERROR() {
  puts("ERROR");
  exit(1);
}


x86 assembly (clang, -O0):
<ERROR>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [6 x i8] c"ERROR\00"
define void @ERROR() {
%1 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [6 x i8] c"ERROR\00"
define void @ERROR() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
void *malloc(int);
int /*<<< orphan*/ stderr;
void *my_malloc(int sz, char *s) {
  void *p = malloc(sz);
  if (p != NULL)
    return p;
  fprintf(stderr, "test: malloc failure for %d bytes in <%s>\n", sz, s);
  exit(1);
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1160 <my_malloc+0x30>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0x10(%rbp),%rcx
lea    0xe89(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<my_malloc>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <malloc@plt>
test   %rax,%rax
je     1149 <my_malloc+0x19>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    0x2e90(%rip),%rax
mov    (%rax),%edi
lea    0xea7(%rip),%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"test: malloc failure for %d bytes in <%s>\0A\00"
define i8* @my_malloc(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i32, i32* %3
%7 = call i8* @malloc(i32 %6)
store i8* %7, i8** %5
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i8*, i8** %5
ret i8* %11
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i32, i32* %3
%15 = load i8*, i8** %4
%16 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %14, i8* %15)
%17 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"test: malloc failure for %d bytes in <%s>\0A\00"
define noalias i8* @my_malloc(i32 %0, i8* %1) {
%3 = tail call i8* @malloc(i32 %0)
%4 = icmp eq i8* %3, null
br i1 %4, label %6, label %5
5: ; preds = %2
ret i8* %3
6: ; preds = %2
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
%9 = tail call i32 @exit(i32 1)
unreachable
}
panic(s) char *s;
{
  putstr("FATAL: ");
  putstr(s);
  halt();
}


x86 assembly (clang, -O0):
<panic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
mov    $0x0,%al
call   1040 <putstr@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <putstr@plt>
mov    $0x0,%al
call   1030 <halt@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<panic>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <putstr@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <putstr@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <halt@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"FATAL: \00"
define i32 @panic(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @putstr to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @putstr to i32 (i8*, ...)*)(i8* %5)
%7 = call i32 (...) @halt()
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [8 x i8] c"FATAL: \00"
define i32 @panic(i8* %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @putstr to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @putstr to i32 (i8*, ...)*)(i8* %0)
%4 = tail call i32 (...) @halt()
ret i32 undef
}
/* Type definitions */
struct Result16 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Result16 *);
void result16_free(struct Result16 *r) { free(r); }


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

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

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

LLVM IR (-O2):
%struct.Result16 = type { i32 }
define void @result16_free(%struct.Result16* nocapture %0) {
%2 = tail call i32 @free(%struct.Result16* %0)
ret void
}
/* Type definitions */
struct hashtab {
  int dummy;
};

/* Variables and functions */
int strcmp(char const *, char const *);
int symcmp(struct hashtab *h, const void *key1, const void *key2) {
  const char *keyp1, *keyp2;
  keyp1 = key1;
  keyp2 = key2;
  return strcmp(keyp1, keyp2);
}


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

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

LLVM IR (-O0):
%struct.hashtab = type { i32 }
define i32 @symcmp(%struct.hashtab* %0, i8* %1, i8* %2) {
%4 = alloca %struct.hashtab*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.hashtab* %0, %struct.hashtab** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %5
store i8* %9, i8** %7
%10 = load i8*, i8** %6
store i8* %10, i8** %8
%11 = load i8*, i8** %7
%12 = load i8*, i8** %8
%13 = call i32 @strcmp(i8* %11, i8* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.hashtab = type { i32 }
define i32 @symcmp(%struct.hashtab* nocapture readnone %0, i8* nocapture %1, i8* nocapture %2) {
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %1, i8* dereferenceable(1) %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void gfx_sleep(int ms) { usleep(ms * 1000); }


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

x86 assembly (clang, -O2):
<gfx_sleep>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @gfx_sleep(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @gfx_sleep(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(float *);
float *del_array(float *array) {
  if (array)
    free(array);
  return NULL;
}


x86 assembly (clang, -O0):
<del_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <del_array+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_array>:
test   %rdi,%rdi
je     111f <del_array+0xf>
push   %rax
call   1030 <free@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
define float* @del_array(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = icmp ne float* %3, null
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load float*, float** %2
%7 = call i32 @free(float* %6)
br label %8
8: ; preds = %5, %1
ret float* null
}

LLVM IR (-O2):
define noalias float* @del_array(float* %0) {
%2 = icmp eq float* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(float* %0)
br label %5
5: ; preds = %3, %1
ret float* null
}
_Bool Long__EQ_(long x, long y) { return x == y; }


x86 assembly (clang, -O0):
<Long__EQ_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Long__EQ_>:
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define zeroext i1 @Long__EQ_(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
ret i1 %7
}

LLVM IR (-O2):
define zeroext i1 @Long__EQ_(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
ret i1 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned short);
void test(short s1) {
  unsigned short us2 = (unsigned short)s1;
  printf("s1   = %d\n", s1);
  printf("us2  = %u\n", us2);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x4(%rbp)
lea    0xed2(%rip),%rdi
movzwl -0x2(%rbp),%esi
call   1030 <printf@plt>
lea    0xecd(%rip),%rdi
movzwl -0x4(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
movzwl %di,%ebx
lea    0xee5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"s1 = %d\0A\00"
@.str.1 = [11 x i8] c"us2 = %u\0A\00"
define void @test(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
store i16 %4, i16* %3
%5 = load i16, i16* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 zeroext %5)
%7 = load i16, i16* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i16 zeroext %7)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"s1 = %d\0A\00"
@.str.1 = [11 x i8] c"us2 = %u\0A\00"
define void @test(i16 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 zeroext %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i16 zeroext %0)
ret void
}