xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ strstr(char *, char *);
int sports_no_bieber(char *s) {
  return strstr(s, "sports") && !strstr(s, "bieber");
}


x86 assembly (clang, -O0):
<sports_no_bieber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     115a <sports_no_bieber+0x4a>
mov    -0x8(%rbp),%rdi
lea    0xebe(%rip),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sports_no_bieber>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strstr@plt>
test   %rax,%rax
je     1141 <sports_no_bieber+0x31>
lea    0xedb(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strstr@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"sports\00"
@.str.1 = [7 x i8] c"bieber\00"
define i32 @sports_no_bieber(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strstr(i8* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i64 @strstr(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
@.str = [7 x i8] c"sports\00"
@.str.1 = [7 x i8] c"bieber\00"
define i32 @sports_no_bieber(i8* %0) {
%2 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strstr(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
void nsrStart2SUBROUTINE_NAME() {}


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

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

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

LLVM IR (-O2):
define void @nsrStart2SUBROUTINE_NAME() {
ret void
}
int cairo_code_draw_squareDial_get_width() { return 88; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_squareDial_get_width() {
ret i32 88
}

LLVM IR (-O2):
define i32 @cairo_code_draw_squareDial_get_width() {
ret i32 88
}
XQueryColors() {}


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

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

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

LLVM IR (-O2):
define i32 @XQueryColors() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int readlink(const char *path, char *buf, size_t bufsize) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<readlink>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @readlink(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @ENOSYS
%8 = call i32 @__set_errno(i32 %7)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @readlink(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
%4 = load i32, i32* @ENOSYS
%5 = tail call i32 @__set_errno(i32 %4)
ret i32 -1
}
/* Variables and functions */
int cpu_cycles();
int /*<<< orphan*/ printf(char *, ...);
void interrupt_handler() {
  printf("\n############################\n");
  printf(" irq recieved @ time : %d\n", cpu_cycles());
  printf("############################\n");
}


x86 assembly (clang, -O0):
<interrupt_handler>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <cpu_cycles@plt>
mov    %eax,%esi
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<interrupt_handler>:
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <cpu_cycles@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [31 x i8] c"\0A############################\0A\00"
@.str.1 = [27 x i8] c" irq recieved @ time : %d\0A\00"
@.str.2 = [30 x i8] c"############################\0A\00"
define void @interrupt_handler() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @cpu_cycles()
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c" irq recieved @ time : %d\0A\00"
@str = [30 x i8] c"\0A############################\00"
@str.3 = [29 x i8] c"############################\00"
define void @interrupt_handler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @cpu_cycles()
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.3, i64 0, i64 0))
ret void
}
int doMultiplication(int v1, int v2) { return v1 * v2; }


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

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

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

LLVM IR (-O2):
define i32 @doMultiplication(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int ssl3_num_ciphers();
int ssl23_num_ciphers(void) { return (ssl3_num_ciphers()); }


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

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

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

LLVM IR (-O2):
define i32 @ssl23_num_ciphers() {
%1 = tail call i32 (...) @ssl3_num_ciphers()
ret i32 %1
}
void pool_cleaner() {}


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

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

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

LLVM IR (-O2):
define void @pool_cleaner() {
ret void
}
int array_equal(int *ar1, int *ar2, int n) {
  int i;
  for (i = 0; i < n; i++)
    if (ar1[i] != ar2[i])
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<array_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    115d <array_equal+0x5d>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     114a <array_equal+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1164 <array_equal+0x64>
jmp    114f <array_equal+0x4f>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1116 <array_equal+0x16>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_equal>:
mov    $0x1,%eax
test   %edx,%edx
jle    1121 <array_equal+0x21>
mov    %edx,%r8d
xor    %edx,%edx
xchg   %ax,%ax
mov    (%rdi,%rdx,4),%ecx
cmp    (%rsi,%rdx,4),%ecx
jne    1122 <array_equal+0x22>
add    $0x1,%rdx
cmp    %rdx,%r8
jne    1110 <array_equal+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @array_equal(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %2 to i64
br label %9
7: ; preds = %9
%8 = icmp eq i64 %16, %6
br i1 %8, label %17, label %9
9: ; preds = %5, %7
%10 = phi i64 [ 0, %5 ], [ %16, %7 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %1, i64 %10
%14 = load i32, i32* %13
%15 = icmp eq i32 %12, %14
%16 = add nuw nsw i64 %10, 1
br i1 %15, label %7, label %17
17: ; preds = %9, %7, %3
%18 = phi i32 [ 1, %3 ], [ 1, %7 ], [ 0, %9 ]
ret i32 %18
}
int otoi(const char *p) {
  int r = 0;
  while (*p) {
    if (*p >= '0' && *p <= '7')
      r = r * 8 + (*(p++) - '0');
    else
      break;
  }
  return r;
}


x86 assembly (clang, -O0):
<otoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <otoi+0x6b>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     1161 <otoi+0x61>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x37,%eax
jg     1161 <otoi+0x61>
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
sub    $0x30,%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1166 <otoi+0x66>
jmp    116b <otoi+0x6b>
jmp    110f <otoi+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<otoi>:
mov    (%rdi),%cl
mov    %ecx,%edx
and    $0xf8,%dl
xor    %eax,%eax
cmp    $0x30,%dl
jne    113a <otoi+0x3a>
add    $0x1,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl %cl,%ecx
lea    (%rcx,%rax,8),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
mov    %ecx,%edx
and    $0xf8,%dl
add    $0x1,%rdi
cmp    $0x30,%dl
je     1120 <otoi+0x20>
ret

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

LLVM IR (-O2):
define i32 @otoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -8
%4 = icmp eq i8 %3, 48
br i1 %4, label %5, label %17
5: ; preds = %1, %5
%6 = phi i8 [ %14, %5 ], [ %2, %1 ]
%7 = phi i32 [ %13, %5 ], [ 0, %1 ]
%8 = phi i8* [ %11, %5 ], [ %0, %1 ]
%9 = zext i8 %6 to i32
%10 = shl nsw i32 %7, 3
%11 = getelementptr inbounds i8, i8* %8, i64 1
%12 = add i32 %10, -48
%13 = add i32 %12, %9
%14 = load i8, i8* %11
%15 = and i8 %14, -8
%16 = icmp eq i8 %15, 48
br i1 %16, label %5, label %17
17: ; preds = %5, %1
%18 = phi i32 [ 0, %1 ], [ %13, %5 ]
ret i32 %18
}
/* Variables and functions */
int close(int);
__attribute__((stdcall)) int closesocket_wrap(int sock) { return close(sock); }


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

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

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

LLVM IR (-O2):
define i32 @closesocket_wrap(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led1On();
void TestAppP__Leds__led1On(void) { LedsP__Leds__led1On(); }


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

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

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

LLVM IR (-O2):
define void @TestAppP__Leds__led1On() {
%1 = tail call i32 (...) @LedsP__Leds__led1On()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int help(const char *name) {
  printf("Usage: %s [--help] [FILE]...\n", name);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"Usage: %s [--help] [FILE]...\0A\00"
define i32 @help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Usage: %s [--help] [FILE]...\0A\00"
define i32 @help(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void print(char *string) { printf("%s\n", string); }


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

x86 assembly (clang, -O2):
<print>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @print(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int pigpio_command(int, int, unsigned int, unsigned int, int);
int set_PWM_range(int pi, unsigned user_gpio, unsigned range) {
  return pigpio_command(pi, 6, user_gpio, range, 1);
}


x86 assembly (clang, -O0):
<set_PWM_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    $0x6,%esi
mov    $0x1,%r8d
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_PWM_range>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x6,%esi
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @set_PWM_range(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pigpio_command(i32 %0, i32 6, i32 %1, i32 %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr,
          "usage: upc-twg8x0 <device> <<serial> | <ssid> [<channel>]>\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"usage: upc-twg8x0 <device> <<serial> | <ssid> [<channel>]>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"usage: upc-twg8x0 <device> <<serial> | <ssid> [<channel>]>\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int prv_test_ptd_examples();
int prv_test_riscos_vfp_examples();
int ptd_test(void) {
  int ret = 0;
  ret |= prv_test_ptd_examples();
  ret |= prv_test_riscos_vfp_examples();
  return ret;
}


x86 assembly (clang, -O0):
<ptd_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <prv_test_ptd_examples@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <prv_test_riscos_vfp_examples@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptd_test>:
push   %rbx
xor    %eax,%eax
call   1040 <prv_test_ptd_examples@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <prv_test_riscos_vfp_examples@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ptd_test() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @prv_test_ptd_examples()
%3 = load i32, i32* %1
%4 = or i32 %3, %2
store i32 %4, i32* %1
%5 = call i32 (...) @prv_test_riscos_vfp_examples()
%6 = load i32, i32* %1
%7 = or i32 %6, %5
store i32 %7, i32* %1
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
define i32 @ptd_test() {
%1 = tail call i32 (...) @prv_test_ptd_examples()
%2 = tail call i32 (...) @prv_test_riscos_vfp_examples()
%3 = or i32 %2, %1
ret i32 %3
}
double f3() {
  double x = 3.0;
  double y = 1 / x;
  return x / 2;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
movsd  0xf04(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define double @f3() {
%1 = alloca double
%2 = alloca double
store double 3.000000e+00, double* %1
%3 = load double, double* %1
%4 = fdiv double 1.000000e+00, %3
store double %4, double* %2
%5 = load double, double* %1
%6 = fdiv double %5, 2.000000e+00
ret double %6
}

LLVM IR (-O2):
define double @f3() {
ret double 1.500000e+00
}
int test_imm_3Cuint16_mem(unsigned short *val) {
  return ((*val) & (0x3C << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_3Cuint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, 60
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_3Cuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 60
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void freematr(char **matr, int m) {
  int x;
  for (x = 0; x < m; x++) {
    free(matr[x]);
  }
  free(matr);
}


x86 assembly (clang, -O0):
<freematr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1151 <freematr+0x41>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <freematr+0x16>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<freematr>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
test   %esi,%esi
jle    1142 <freematr+0x32>
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdi
call   1030 <free@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <freematr+0x20>
mov    %r14,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @freematr(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
tail call void @free(i8* %9)
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = bitcast i8** %0 to i8*
tail call void @free(i8* %13)
ret void
}
int bibl_illegaloutmode(int mode) {
  if (mode < (200) || mode > ((200) + 5))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<bibl_illegaloutmode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xc8,-0x8(%rbp)
jl     1121 <bibl_illegaloutmode+0x21>
cmpl   $0xcd,-0x8(%rbp)
jle    112d <bibl_illegaloutmode+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <bibl_illegaloutmode+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bibl_illegaloutmode>:
add    $0xffffff32,%edi
xor    %eax,%eax
cmp    $0xfffffffa,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @bibl_illegaloutmode(i32 %0) {
%2 = add i32 %0, -206
%3 = icmp ult i32 %2, -6
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_format_info_get_rate() {
  printf("NOT IMPLEMENTED:"
         "pa_format_info_get_rate"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [40 x i8] c"NOT IMPLEMENTED:pa_format_info_get_rate\00"
define i32 @pa_format_info_get_rate() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_format_info_get_channel_map() {
  printf("NOT IMPLEMENTED:"
         "pa_format_info_get_channel_map"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [47 x i8] c"NOT IMPLEMENTED:pa_format_info_get_channel_map\00"
define i32 @pa_format_info_get_channel_map() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ malloc(int);
int main() {
  malloc(512 * 1024 * 1024);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @malloc(i32 536870912)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @malloc(i32 536870912)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int eq(char *str1, char *str2) {
  if (strcmp(str1, str2) != 0) {
    printf("Error %s != %s\n", str1, str2);
    return 0;
  }
  printf(".");
  return 1;
}


x86 assembly (clang, -O0):
<eq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1169 <eq+0x49>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    117e <eq+0x5e>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eq>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <strcmp@plt>
test   %rax,%rax
je     115c <eq+0x2c>
lea    0xeb5(%rip),%rdi
xor    %ebp,%ebp
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    116b <eq+0x3b>
mov    $0x2e,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Error %s != %s\0A\00"
@.str.1 = [2 x i8] c".\00"
define i32 @eq(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i8*, i8** %5
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %12)
store i32 0, i32* %3
br label %16
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %16
16: ; preds = %14, %10
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [16 x i8] c"Error %s != %s\0A\00"
define i32 @eq(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @putchar(i32 46)
br label %9
9: ; preds = %7, %5
%10 = phi i32 [ 0, %5 ], [ 1, %7 ]
ret i32 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
scalar_t__ ptsname_r(int, char *, int);
char *ptsname(int fd) {
  static char buf[128];
  if (ptsname_r(fd, buf, sizeof(buf)) < 0)
    return NULL;
  return buf;
}


x86 assembly (clang, -O0):
<ptsname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
lea    0x2f1b(%rip),%rsi
mov    $0x80,%edx
call   1030 <ptsname_r@plt>
cmp    $0x0,%rax
jge    1146 <ptsname+0x36>
movq   $0x0,-0x8(%rbp)
jmp    1151 <ptsname+0x41>
lea    0x2ef3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ptsname>:
push   %rbx
lea    0x2f28(%rip),%rbx
mov    %rbx,%rsi
mov    $0x80,%edx
call   1030 <ptsname_r@plt>
xor    %ecx,%ecx
test   %rax,%rax
cmovns %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@ptsname.buf = internal global [128 x i8] zeroinitializer
define i8* @ptsname(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @ptsname_r(i32 %4, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ptsname.buf, i64 0, i64 0), i32 128)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ptsname.buf, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@ptsname.buf = internal global [128 x i8] zeroinitializer
define i8* @ptsname(i32 %0) {
%2 = tail call i64 @ptsname_r(i32 %0, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ptsname.buf, i64 0, i64 0), i32 128)
%3 = icmp slt i64 %2, 0
%4 = select i1 %3, i8* null, i8* getelementptr inbounds ([128 x i8], [128 x i8]* @ptsname.buf, i64 0, i64 0)
ret i8* %4
}
int isPalindrome(int a) {
  int arr[100];
  while (a) {
  }
}


x86 assembly (clang, -O0):
<isPalindrome>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     111d <isPalindrome+0x1d>
jmp    110e <isPalindrome+0xe>
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPalindrome>:
test   %edi,%edi
je     1112 <isPalindrome+0x12>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
jmp    1110 <isPalindrome+0x10>
ret

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

LLVM IR (-O2):
define i32 @isPalindrome(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret i32 undef
}
int close(int fildes) { return 0; }


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

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

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

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

/* Variables and functions */
size_t sb_utf8n32(uint32_t wc) {
  size_t len;
  if (wc < 0x000080) {
    len = 1;
  } else if (wc < 0x00800) {
    len = 2;
  } else if (wc < 0x10000) {
    len = 3;
  } else if (wc < 0x11000) {
    len = 4;
  } else {
    len = 0;
  }
  return len;
}


x86 assembly (clang, -O0):
<sb_utf8n32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x80,-0x4(%rbp)
jge    1121 <sb_utf8n32+0x21>
movq   $0x1,-0x10(%rbp)
jmp    1186 <sb_utf8n32+0x86>
cmpl   $0x800,-0x4(%rbp)
jge    113b <sb_utf8n32+0x3b>
movq   $0x2,-0x10(%rbp)
jmp    1181 <sb_utf8n32+0x81>
cmpl   $0x10000,-0x4(%rbp)
jge    1155 <sb_utf8n32+0x55>
movq   $0x3,-0x10(%rbp)
jmp    117c <sb_utf8n32+0x7c>
cmpl   $0x11000,-0x4(%rbp)
jge    116f <sb_utf8n32+0x6f>
movq   $0x4,-0x10(%rbp)
jmp    1177 <sb_utf8n32+0x77>
movq   $0x0,-0x10(%rbp)
jmp    117c <sb_utf8n32+0x7c>
jmp    1181 <sb_utf8n32+0x81>
jmp    1186 <sb_utf8n32+0x86>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sb_utf8n32>:
mov    $0x1,%eax
cmp    $0x80,%edi
jl     1136 <sb_utf8n32+0x36>
mov    $0x2,%eax
cmp    $0x800,%edi
jb     1136 <sb_utf8n32+0x36>
mov    $0x3,%eax
cmp    $0x10000,%edi
jb     1136 <sb_utf8n32+0x36>
xor    %eax,%eax
cmp    $0x11000,%edi
setb   %al
shl    $0x2,%rax
ret

LLVM IR (-O0):
define i64 @sb_utf8n32(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 128
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %3
br label %23
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 2048
br i1 %9, label %10, label %11
10: ; preds = %7
store i64 2, i64* %3
br label %22
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 65536
br i1 %13, label %14, label %15
14: ; preds = %11
store i64 3, i64* %3
br label %21
15: ; preds = %11
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 69632
br i1 %17, label %18, label %19
18: ; preds = %15
store i64 4, i64* %3
br label %20
19: ; preds = %15
store i64 0, i64* %3
br label %20
20: ; preds = %19, %18
br label %21
21: ; preds = %20, %14
br label %22
22: ; preds = %21, %10
br label %23
23: ; preds = %22, %6
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
define i64 @sb_utf8n32(i32 %0) {
%2 = icmp slt i32 %0, 128
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2048
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 65536
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 69632
%9 = select i1 %8, i64 4, i64 0
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i64 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i64 %11
}
int smituseradd(void) {}


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

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

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

LLVM IR (-O2):
define i32 @smituseradd() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
int main(void) {
  char s1[] = "ABC";
  char s2[] = "AB\\0CDEF";
  printf("[%s]\t[%s]\n", s1, s2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xedb(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xed5(%rip),%rax
mov    %rax,-0x11(%rbp)
mov    0xed3(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0x8(%rbp),%rsi
lea    -0x11(%rbp),%rdx
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x434241,0x4(%rsp)
movabs $0x46454443305c4241,%rax
44 45 46
mov    %rax,0x8(%rsp)
movb   $0x0,0x10(%rsp)
lea    0xed2(%rip),%rdi
lea    0x4(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.s2 = [9 x i8] c"AB\\0CDEF\00"
@.str = [11 x i8] c"[%s]\09[%s]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i8]
%3 = bitcast i32* %1 to i8*
store i32 4407873, i32* %1
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
}
unsigned int Min(unsigned int a, unsigned int b) {
  if (a < b) {
    return a;
  } else {
    return b;
  }
  __builtin_unreachable();
}


x86 assembly (clang, -O0):
<Min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1121 <Min+0x21>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1127 <Min+0x27>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Min>:
mov    %esi,%eax
cmp    %esi,%edi
cmovb  %edi,%eax
ret

LLVM IR (-O0):
define i32 @Min(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* %4
%7 = load i32, i32* %5
%8 = icmp ult i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %13
11: ; preds = %2
%12 = load i32, i32* %5
store i32 %12, i32* %3
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @Min(i32 %0, i32 %1) {
%3 = icmp ult i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printLineOfChars(char *ch, int nooftimes) {
  char c = *ch;
  int j = 1;
  for (j = 1; j <= nooftimes; j++) {
    printf("%c", c);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<printLineOfChars>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1162 <printLineOfChars+0x52>
movsbl -0xd(%rbp),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1136 <printLineOfChars+0x26>
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLineOfChars>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112c <printLineOfChars+0x1c>
mov    %esi,%ebx
movsbl (%rdi),%ebp
nopl   0x0(%rax)
mov    %ebp,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <printLineOfChars+0x10>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printLineOfChars(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i32 1, i32* %6
store i32 1, i32* %6
br label %9
9: ; preds = %17, %2
%10 = load i32, i32* %6
%11 = load i32, i32* %4
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %20
13: ; preds = %9
%14 = load i8, i8* %5
%15 = sext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %13
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %9
20: ; preds = %9
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printLineOfChars(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 1
br i1 %3, label %12, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = sext i8 %5 to i32
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ 1, %4 ], [ %10, %7 ]
%9 = tail call i32 @putchar(i32 %6)
%10 = add nuw i32 %8, 1
%11 = icmp eq i32 %8, %1
br i1 %11, label %12, label %7
12: ; preds = %7, %2
%13 = tail call i32 @putchar(i32 10)
ret void
}
int innetgr(const char *netgroup, const char *host, const char *user,
            const char *domain) {
  return 0;
}


x86 assembly (clang, -O0):
<innetgr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @innetgr(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 0
}

LLVM IR (-O2):
define i32 @innetgr(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int nl_sendgetaddr_do(int, int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/, int /*<<< orphan*/,
                      int /*<<< orphan*/);
int nl_sendgetaddrs(int fd, uint32_t seq) {
  return nl_sendgetaddr_do(fd, seq, 0, 0, 0, 0);
}


x86 assembly (clang, -O0):
<nl_sendgetaddrs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
xor    %r9d,%r9d
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <nl_sendgetaddr_do@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nl_sendgetaddrs>:
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <nl_sendgetaddr_do@plt>

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

LLVM IR (-O2):
define i32 @nl_sendgetaddrs(i32 %0, i32 %1) {
%3 = tail call i32 @nl_sendgetaddr_do(i32 %0, i32 %1, i32 0, i32 0, i32 0, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ SIZE_MAX;
int vsnprintf(char *, int /*<<< orphan*/, char const *, int /*<<< orphan*/);
int vsprintf(char *s, const char *format, va_list arg) {
  return vsnprintf(s, SIZE_MAX, format, arg);
}


x86 assembly (clang, -O0):
<vsprintf>:
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    0x2eaa(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <vsnprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vsprintf>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
jmp    1030 <vsnprintf@plt>

LLVM IR (-O0):
@SIZE_MAX = global i32 0
define i32 @vsprintf(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* @SIZE_MAX
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = call i32 @vsnprintf(i8* %7, i32 %8, i8* %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
@SIZE_MAX = global i32 0
define i32 @vsprintf(i8* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = load i32, i32* @SIZE_MAX
%5 = tail call i32 @vsnprintf(i8* %0, i32 %4, i8* %1, i32 %2)
ret i32 %5
}
void g_bit_nth_lsf() {}


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

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

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

LLVM IR (-O2):
define void @g_bit_nth_lsf() {
ret void
}
int hello(int a) {
  int hello;
  a = a + 3;
  return a;
}


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

x86 assembly (clang, -O2):
<hello>:
lea    0x3(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @hello(i32 %0) {
%2 = add nsw i32 %0, 3
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ callrts(char *);
void convUint2doub(void) { callrts("ufloat"); }


x86 assembly (clang, -O0):
<convUint2doub>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <callrts@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"ufloat\00"
define void @convUint2doub() {
%1 = call i32 @callrts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"ufloat\00"
define void @convUint2doub() {
%1 = tail call i32 @callrts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}