xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t add(int64_t a, int64_t b) { return a + b; }


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

x86 assembly (clang, -O2):
<add>:
lea    (%rdi,%rsi,1),%rax
ret

LLVM IR (-O0):
define i64 @add(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 = add nsw i64 %5, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @add(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ FLASH_waitData();
void FLASH_waitOpt(void) { FLASH_waitData(); }


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

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

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

LLVM IR (-O2):
define void @FLASH_waitOpt() {
%1 = tail call i32 (...) @FLASH_waitData()
ret void
}
/* Variables and functions */
unsigned int getColorFromRGBA(float, float, float, double);
unsigned int getColorFromRGB(float red, float green, float blue) {
  return getColorFromRGBA(red, green, blue, 1.0);
}


x86 assembly (clang, -O0):
<getColorFromRGB>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movsd  0xec2(%rip),%xmm3
call   1030 <getColorFromRGBA@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getColorFromRGB>:
movsd  0xee8(%rip),%xmm3
jmp    1030 <getColorFromRGBA@plt>

LLVM IR (-O0):
define i32 @getColorFromRGB(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call i32 @getColorFromRGBA(float %7, float %8, float %9, double 1.000000e+00)
ret i32 %10
}

LLVM IR (-O2):
define i32 @getColorFromRGB(float %0, float %1, float %2) {
%4 = tail call i32 @getColorFromRGBA(float %0, float %1, float %2, double 1.000000e+00)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ blockg();
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("\n");
  blockg();
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <blockg@plt>
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 10)
%2 = tail call i32 (...) @blockg()
%3 = tail call i32 @putchar(i32 10)
ret i32 0
}
void av_fifo_generic_peek_at() {}


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

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

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

LLVM IR (-O2):
define void @av_fifo_generic_peek_at() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
int main(void) {
  const int N = 5;
  int a[5] = {2, 1, 3, 1, 4};
  int tmp1 = 0;
  int tmp2 = 0;
  for (int i = 0; i < N; ++i) {
    tmp1 += (i + 1);
    tmp2 += a[i];
  }
  printf("ÖØ¸´µÄÊý:%d\n", N - (tmp1 - tmp2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    0xed3(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed0(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xece(%rip),%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x5,-0x2c(%rbp)
jge    118c <main+0x7c>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
movslq -0x2c(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
add    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    115a <main+0x4a>
mov    -0x24(%rbp),%eax
sub    -0x28(%rbp),%eax
mov    $0x5,%esi
sub    %eax,%esi
lea    0xe74(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.main.a = [5 x i32] [i32 2, i32 1, i32 3, i32 1, i32 4]
@.str = [21 x i8] c"\C3\96\C3\98\C2\B8\C2\B4\C2\B5\C3\84\C3\8A\C3\BD:%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [5 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 5, i32* %2
%7 = bitcast [5 x i32]* %3 to i8*
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
br label %8
8: ; preds = %22, %0
%9 = load i32, i32* %6
%10 = icmp slt i32 %9, 5
br i1 %10, label %11, label %25
11: ; preds = %8
%12 = load i32, i32* %6
%13 = add nsw i32 %12, 1
%14 = load i32, i32* %4
%15 = add nsw i32 %14, %13
store i32 %15, i32* %4
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %3, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = load i32, i32* %5
%21 = add nsw i32 %20, %19
store i32 %21, i32* %5
br label %22
22: ; preds = %11
%23 = load i32, i32* %6
%24 = add nsw i32 %23, 1
store i32 %24, i32* %6
br label %8
25: ; preds = %8
%26 = load i32, i32* %4
%27 = load i32, i32* %5
%28 = sub nsw i32 %26, %27
%29 = sub nsw i32 5, %28
%30 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"\C3\96\C3\98\C2\B8\C2\B4\C2\B5\C3\84\C3\8A\C3\BD:%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
void uninivar_strcpy(void) {
  char *str1;
  char *str2;
  (void)strcpy(str1, str2);
}


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

x86 assembly (clang, -O2):
<uninivar_strcpy>:
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
define void @uninivar_strcpy() {
%1 = alloca i8*
%2 = alloca i8*
%3 = load i8*, i8** %1
%4 = load i8*, i8** %2
%5 = call i32 @strcpy(i8* %3, i8* %4)
ret void
}

LLVM IR (-O2):
define void @uninivar_strcpy() {
%1 = tail call i32 @strcpy(i8* undef, i8* undef)
ret void
}
__attribute__((__format__(__printf__, 1, 2))) void
cpuinfo_log_warning(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @cpuinfo_log_warning(i8* nocapture %0, ...) {
ret void
}
unsigned int sdbmHash(void *k) {
  unsigned long h = 0;
  int c;
  char *key = (char *)k;
  while ((c = *key++)) {
    h = c + (h << 6) + (h << 16) - h;
  }
  return h;
}


x86 assembly (clang, -O0):
<sdbmHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     115d <sdbmHash+0x5d>
movslq -0x14(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x6,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
shl    $0x10,%rcx
add    %rcx,%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1118 <sdbmHash+0x18>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sdbmHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112a <sdbmHash+0x2a>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbq %cl,%rcx
imul   $0x1003f,%rax,%rax
add    %rcx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <sdbmHash+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @sdbmHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = sext i8 %5 to i64
%10 = mul i64 %7, 65599
%11 = add i64 %10, %9
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = trunc i64 %11 to i32
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
char *strtok(char *, char *);
int countTokens(char *text) {
  char *tokenPtr;
  int count = 0;
  tokenPtr = strtok(text, " \n");
  while (tokenPtr != NULL) {
    count++;
    tokenPtr = strtok(NULL, " \n");
  }
  return count;
}


x86 assembly (clang, -O0):
<countTokens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1164 <countTokens+0x54>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
mov    %eax,%edi
lea    0xeaa(%rip),%rsi
call   1030 <strtok@plt>
mov    %rax,-0x10(%rbp)
jmp    1137 <countTokens+0x27>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<countTokens>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rsi
call   1030 <strtok@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1142 <countTokens+0x32>
lea    0xed2(%rip),%r14
xchg   %ax,%ax
add    $0x1,%ebx
xor    %edi,%edi
mov    %r14,%rsi
call   1030 <strtok@plt>
test   %rax,%rax
jne    1130 <countTokens+0x20>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c" \0A\00"
define i32 @countTokens(i8* %0) {
%2 = tail call i8* @strtok(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i32 %5, 1
%7 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %4
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %6, %4 ]
ret i32 %10
}
int cmp_ushort_gt(const void *a, const void *b) {
  unsigned short a_ = *(unsigned short *)a;
  unsigned short b_ = *(unsigned short *)b;
  if (a_ > b_)
    return -1;
  if (a_ < b_)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<cmp_ushort_gt>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1a(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x1c(%rbp)
movzwl -0x1a(%rbp),%eax
movzwl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jle    113e <cmp_ushort_gt+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1161 <cmp_ushort_gt+0x61>
movzwl -0x1a(%rbp),%eax
movzwl -0x1c(%rbp),%ecx
cmp    %ecx,%eax
jge    115a <cmp_ushort_gt+0x5a>
movl   $0x1,-0x4(%rbp)
jmp    1161 <cmp_ushort_gt+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_ushort_gt>:
movzwl (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%ax
setb   %cl
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_ushort_gt(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i16
%7 = alloca i16
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i16*
%10 = load i16, i16* %9
store i16 %10, i16* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i16*
%13 = load i16, i16* %12
store i16 %13, i16* %7
%14 = load i16, i16* %6
%15 = zext i16 %14 to i32
%16 = load i16, i16* %7
%17 = zext i16 %16 to i32
%18 = icmp sgt i32 %15, %17
br i1 %18, label %19, label %20
19: ; preds = %2
store i32 -1, i32* %3
br label %28
20: ; preds = %2
%21 = load i16, i16* %6
%22 = zext i16 %21 to i32
%23 = load i16, i16* %7
%24 = zext i16 %23 to i32
%25 = icmp slt i32 %22, %24
br i1 %25, label %26, label %27
26: ; preds = %20
store i32 1, i32* %3
br label %28
27: ; preds = %20
store i32 0, i32* %3
br label %28
28: ; preds = %27, %26, %19
%29 = load i32, i32* %3
ret i32 %29
}

LLVM IR (-O2):
define i32 @cmp_ushort_gt(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i16*
%4 = load i16, i16* %3
%5 = bitcast i8* %1 to i16*
%6 = load i16, i16* %5
%7 = icmp ugt i16 %4, %6
%8 = icmp ult i16 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
AX0I1(r0, r1, x0, x1, p0, p1) unsigned char r0, r1;
unsigned char *p0, *p1;
{
  if ((((unsigned char *)10000000)[x0]) <= 33)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AX0I1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %dil,%sil
mov    %sil,-0x5(%rbp)
mov    %al,-0x6(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movslq -0xc(%rbp),%rcx
mov    $0x989680,%eax
movzbl (%rax,%rcx,1),%eax
cmp    $0x21,%eax
jg     1140 <AX0I1+0x40>
movl   $0x1,-0x4(%rbp)
jmp    1147 <AX0I1+0x47>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AX0I1>:
movslq %edx,%rcx
xor    %eax,%eax
cmpb   $0x22,0x989680(%rcx)
setb   %al
ret

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

LLVM IR (-O2):
define i32 @AX0I1(i32 %0, i32 %1, i32 %2, i32 %3, i8* nocapture readnone %4, i8* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i8, i8* inttoptr (i64 10000000 to i8*), i64 %7
%9 = load i8, i8* %8
%10 = icmp ult i8 %9, 34
%11 = zext i1 %10 to i32
ret i32 %11
}
void foo775(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo775(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ index_add_arg(char *);
void cm_findex(void) { index_add_arg("fn"); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"fn\00"
define void @cm_findex() {
%1 = tail call i32 @index_add_arg(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
int reverse(int x) {
  int p, rev = 0;
  while (x > 0) {
    p = x % 10;
    rev = rev * 10 + p;
    x /= 10;
  }
  return rev;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1143 <reverse+0x43>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
imul   $0xa,-0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <reverse+0xe>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %eax,%eax
test   %edi,%edi
jle    1131 <reverse+0x31>
mov    $0xcccccccd,%r8d
nopl   0x0(%rax)
lea    (%rax,%rax,4),%eax
mov    %edi,%edx
imul   %r8,%rdx
shr    $0x23,%rdx
lea    (%rdx,%rdx,1),%esi
lea    (%rsi,%rsi,4),%esi
mov    %edi,%ecx
sub    %esi,%ecx
lea    (%rcx,%rax,2),%eax
cmp    $0x9,%edi
mov    %edx,%edi
ja     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ %0, %1 ]
%6 = urem i32 %5, 10
%7 = mul nsw i32 %4, 10
%8 = add nsw i32 %7, %6
%9 = udiv i32 %5, 10
%10 = icmp ult i32 %5, 10
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
char *add_heapptr_tag(char *p, unsigned int tag) { return (p + tag); }


x86 assembly (clang, -O0):
<add_heapptr_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_heapptr_tag>:
mov    %esi,%eax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i8* @add_heapptr_tag(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = zext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
ret i8* %8
}

LLVM IR (-O2):
define i8* @add_heapptr_tag(i8* readnone %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
ret i8* %4
}
int comp(const void *x, const void *y) {
  const float *a = x;
  const float *b = y;
  return ((*a >= *b) ? ((*a > *b) ? -1 : 0) : 1);
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
ucomiss (%rax),%xmm0
jb     1156 <comp+0x56>
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x20(%rbp),%rax
movss  (%rax),%xmm1
xor    %eax,%eax
mov    $0xffffffff,%ecx
ucomiss %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x24(%rbp)
jmp    1163 <comp+0x63>
mov    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1163 <comp+0x63>
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
neg    %ecx
ucomiss %xmm1,%xmm0
mov    $0x1,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca float*
%6 = alloca float*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to float*
store float* %8, float** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to float*
store float* %10, float** %6
%11 = load float*, float** %5
%12 = load float, float* %11
%13 = load float*, float** %6
%14 = load float, float* %13
%15 = fcmp oge float %12, %14
br i1 %15, label %16, label %24
16: ; preds = %2
%17 = load float*, float** %5
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = load float, float* %19
%21 = fcmp ogt float %18, %20
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 -1, i32 0
br label %25
24: ; preds = %2
br label %25
25: ; preds = %24, %16
%26 = phi i32 [ %23, %16 ], [ 1, %24 ]
ret i32 %26
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = bitcast i8* %1 to float*
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fcmp ult float %5, %6
%8 = fcmp ogt float %5, %6
%9 = sext i1 %8 to i32
%10 = select i1 %7, i32 1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(const char *name) {
  printf("usage: %s [options] infile.asm\n", name);
  printf("where options are:\n");
  printf(" -o outfile     : Output file\n");
  printf(" -v             : Verbose mode\n");
}


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

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
lea    0xf00(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"usage: %s [options] infile.asm\0A\00"
@.str.1 = [20 x i8] c"where options are:\0A\00"
@.str.2 = [31 x i8] c" -o outfile : Output file\0A\00"
@.str.3 = [32 x i8] c" -v : Verbose mode\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"usage: %s [options] infile.asm\0A\00"
@str = [19 x i8] c"where options are:\00"
@str.4 = [30 x i8] c" -o outfile : Output file\00"
@str.5 = [31 x i8] c" -v : Verbose mode\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.5, i64 0, i64 0))
ret void
}
/* Variables and functions */
int arg_rest(char **);
int dialog_fselect(char const *, char *, int /*<<< orphan*/,
                   int /*<<< orphan*/);
int /*<<< orphan*/ numeric_arg(char **, int);
int call_fselect(const char *t, char *av[], int *offset_add) {
  *offset_add = arg_rest(av);
  return dialog_fselect(t, av[1], numeric_arg(av, 2), numeric_arg(av, 3));
}


x86 assembly (clang, -O0):
<call_fselect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <arg_rest@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2,%esi
call   1040 <numeric_arg@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1040 <numeric_arg@plt>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
call   1050 <dialog_fselect@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_fselect>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <arg_rest@plt>
mov    %eax,(%r14)
mov    0x8(%rbx),%r14
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <numeric_arg@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <numeric_arg@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <dialog_fselect@plt>

LLVM IR (-O0):
define i32 @call_fselect(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*** %5
%8 = call i32 @arg_rest(i8** %7)
%9 = load i32*, i32** %6
store i32 %8, i32* %9
%10 = load i8*, i8** %4
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = call i32 @numeric_arg(i8** %14, i32 2)
%16 = load i8**, i8*** %5
%17 = call i32 @numeric_arg(i8** %16, i32 3)
%18 = call i32 @dialog_fselect(i8* %10, i8* %13, i32 %15, i32 %17)
ret i32 %18
}

LLVM IR (-O2):
define i32 @call_fselect(i8* %0, i8** %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @arg_rest(i8** %1)
store i32 %4, i32* %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @numeric_arg(i8** %1, i32 2)
%8 = tail call i32 @numeric_arg(i8** %1, i32 3)
%9 = tail call i32 @dialog_fselect(i8* %0, i8* %6, i32 %7, i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ DrawText123(char const *, unsigned long, unsigned long);
void drawtext(const char *s, unsigned long cfg, unsigned long cbg) {
  DrawText123(s, cfg, cbg);
}


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

x86 assembly (clang, -O2):
<drawtext>:
jmp    1030 <DrawText123@plt>

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

LLVM IR (-O2):
define void @drawtext(i8* %0, i64 %1, i64 %2) {
%4 = tail call i32 @DrawText123(i8* %0, i64 %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ o_d(int);
int /*<<< orphan*/ o_s(char *);
int /*<<< orphan*/ printv(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void failsd(char *str, char *s, int i) {
  printv("ERR: %% failed with: %%, %%\n", o_s(str), o_d(i), o_s(s));
  exit(1);
}


x86 assembly (clang, -O0):
<failsd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <o_s@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <o_d@plt>
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <o_s@plt>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    %eax,%ecx
lea    0xe7e(%rip),%rdi
call   1030 <printv@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<failsd>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %rsi,%r14
call   1040 <o_s@plt>
mov    %eax,%ebp
mov    %ebx,%edi
call   1050 <o_d@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1040 <o_s@plt>
lea    0xe98(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
call   1030 <printv@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"ERR: %% failed with: %%, %%\0A\00"
define void @failsd(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 = call i32 @o_s(i8* %7)
%9 = load i32, i32* %6
%10 = call i32 @o_d(i32 %9)
%11 = load i8*, i8** %5
%12 = call i32 @o_s(i8* %11)
%13 = call i32 @printv(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %8, i32 %10, i32 %12)
%14 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [29 x i8] c"ERR: %% failed with: %%, %%\0A\00"
define void @failsd(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @o_s(i8* %0)
%5 = tail call i32 @o_d(i32 %2)
%6 = tail call i32 @o_s(i8* %1)
%7 = tail call i32 @printv(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5, i32 %6)
%8 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ trim_character(char *, char, char *);
int timlib_atoi(char *s) {
  char buffer[1024];
  if (!s)
    return 0;
  trim_character(buffer, ',', s);
  return atoi(buffer);
}


x86 assembly (clang, -O0):
<timlib_atoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <timlib_atoi+0x26>
movl   $0x0,-0x4(%rbp)
jmp    116a <timlib_atoi+0x4a>
lea    -0x410(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x2c,%esi
call   1030 <trim_character@plt>
lea    -0x410(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_atoi>:
test   %rdi,%rdi
je     1151 <timlib_atoi+0x31>
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1030 <trim_character@plt>
mov    %rbx,%rdi
call   1040 <atoi@plt>
add    $0x400,%rsp
pop    %rbx
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @timlib_atoi(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [1024 x i8]
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %14
8: ; preds = %1
%9 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%10 = load i8*, i8** %3
%11 = call i32 @trim_character(i8* %9, i8 signext 44, i8* %10)
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* %2
br label %14
14: ; preds = %8, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @timlib_atoi(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = icmp eq i8* %0, null
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = call i32 @trim_character(i8* %3, i8 signext 44, i8* %0)
%7 = call i32 @atoi(i8* %3)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ 0, %1 ]
ret i32 %9
}
unsigned ls0(unsigned n) {
  unsigned count;
  n = ~n;
  __asm__("bsfl %1,%0" : "=r"(count) : "rm"(n));
  return count;
}


x86 assembly (clang, -O0):
<ls0>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
bsf    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ls0>:
not    %edi
mov    %edi,-0x4(%rsp)
bsf    -0x4(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @ls0(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = xor i32 %4, -1
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 asm "bsfl $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @ls0(i32 %0) {
%2 = xor i32 %0, -1
%3 = tail call i32 asm "bsfl $1,$0", "=r,rm,~{dirflag},~{fpsr},~{flags}"(i32 %2)
ret i32 %3
}
long c_fib(int n) {
  if (n <= 2) {
    return 1;
  }
  return c_fib(n - 2) + c_fib(n - 1);
}


x86 assembly (clang, -O0):
<c_fib>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jg     1132 <c_fib+0x22>
movq   $0x1,-0x8(%rbp)
jmp    115a <c_fib+0x4a>
mov    -0xc(%rbp),%edi
sub    $0x2,%edi
call   1030 <c_fib@plt>
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <c_fib@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_fib>:
push   %r14
push   %rbx
push   %rax
mov    $0x1,%r14d
cmp    $0x3,%edi
jl     1147 <c_fib+0x37>
mov    %edi,%ebx
add    $0x1,%ebx
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
lea    -0x3(%rbx),%edi
call   1030 <c_fib@plt>
add    %rax,%r14
add    $0xffffffff,%ebx
cmp    $0x3,%ebx
ja     1130 <c_fib+0x20>
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @c_fib(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ %0, %1 ]
%5 = phi i64 [ %9, %3 ], [ 0, %1 ]
%6 = add nsw i32 %4, -2
%7 = tail call i64 @c_fib(i32 %6)
%8 = add nsw i32 %4, -1
%9 = add nsw i64 %7, %5
%10 = icmp ult i32 %4, 4
br i1 %10, label %11, label %3
11: ; preds = %3
%12 = add i64 %9, 1
br label %13
13: ; preds = %11, %1
%14 = phi i64 [ 1, %1 ], [ %12, %11 ]
ret i64 %14
}
/* Variables and functions */
int /*<<< orphan*/ f(int *, int *);
int main() {
  int *a, *b;
  f(a, b);
  return *a + *b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <f@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x18(%rbp),%rcx
add    (%rcx),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
store i32 0, i32* %1
%4 = load i32*, i32** %2
%5 = load i32*, i32** %3
%6 = call i32 @f(i32* %4, i32* %5)
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = add nsw i32 %8, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32* undef, i32* undef)
ret i32 undef
}
void gtk_menu_item_set_accel_path() {}


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

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

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

LLVM IR (-O2):
define void @gtk_menu_item_set_accel_path() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ main(int, char **);
void _start(int argc, char **argv) { exit(main(argc, argv)); }


x86 assembly (clang, -O0):
<_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <main@plt>
mov    %eax,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<_start>:
push   %rax
call   1030 <main@plt>
mov    %eax,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
define void @_start(i32 %0, i8** %1) {
%3 = tail call i32 @main(i32 %0, i8** %1)
%4 = tail call i32 @exit(i32 %3)
unreachable
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ alarm(int);
int /*<<< orphan*/ err_sys(char *);
struct passwd *getpwnam(char *);
int /*<<< orphan*/ printf(char *);
void my_alarm(int signo) {
  struct passwd *root;
  printf("in signal handler\n");
  if ((root = getpwnam("root")) == NULL) {
    err_sys("error on getpwent");
  }
  alarm(1);
}


x86 assembly (clang, -O0):
<my_alarm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
lea    0xeb5(%rip),%rdi
call   1060 <getpwnam@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    117d <my_alarm+0x3d>
lea    0xea0(%rip),%rdi
call   1030 <err_sys@plt>
mov    $0x1,%edi
call   1050 <alarm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_alarm>:
push   %rax
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
call   1060 <getpwnam@plt>
test   %rax,%rax
jne    116a <my_alarm+0x2a>
lea    0xea0(%rip),%rdi
call   1040 <err_sys@plt>
mov    $0x1,%edi
pop    %rax
jmp    1050 <alarm@plt>

LLVM IR (-O0):
%struct.passwd = type { i32 }
@.str = [19 x i8] c"in signal handler\0A\00"
@.str.1 = [5 x i8] c"root\00"
@.str.2 = [18 x i8] c"error on getpwent\00"
define void @my_alarm(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.passwd*
store i32 %0, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%5 = call %struct.passwd* @getpwnam(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
store %struct.passwd* %5, %struct.passwd** %3
%6 = icmp eq %struct.passwd* %5, null
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @err_sys(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %1
%10 = call i32 @alarm(i32 1)
ret void
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
@.str.1 = [5 x i8] c"root\00"
@.str.2 = [18 x i8] c"error on getpwent\00"
@str = [18 x i8] c"in signal handler\00"
define void @my_alarm(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%3 = tail call %struct.passwd* @getpwnam(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq %struct.passwd* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @err_sys(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
%8 = tail call i32 @alarm(i32 1)
ret void
}
char to_hex_char(int v) {
  return (char)(((v) >= 0 && (v) < 10) ? (v + '0') : (v - 10 + 'a'));
}


x86 assembly (clang, -O0):
<to_hex_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1129 <to_hex_char+0x29>
cmpl   $0xa,-0x4(%rbp)
jge    1129 <to_hex_char+0x29>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1135 <to_hex_char+0x35>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_hex_char>:
lea    0x57(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i8 @to_hex_char(i32 %0) {
%2 = icmp ult i32 %0, 10
%3 = select i1 %2, i32 48, i32 87
%4 = add nsw i32 %3, %0
%5 = trunc i32 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void restore_screen() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @restore_screen() {
%1 = tail call i32 (...) @endwin()
ret void
}
void regexp_void(void) {}


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

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

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

LLVM IR (-O2):
define void @regexp_void() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage() {
  printf("\nUsage:\n   %s\n\n",
         "trim"
         " [-log <logfile>] [-height height] [-width width] \n "
         "        [-to <metadata file>] [-license] [-version] [-help]\n"
         "        [-lat1 <lat> -lat2 <lat> -lon1 <lon> -lon2 <lon>]\n"
         "        <infile> <outfile> <new_top_line> <new_left_sample>\n");
}


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"\0AUsage:\0A %s\0A\0A\00"
@.str.1 = [235 x i8] c"trim [-log <logfile>] [-height height] [-width width] \0A [-to <metadata file>] [-license] [-version] [-help]\0A [-lat1 <lat> -lat2 <lat> -lon1 <lon> -lon2 <lon>]\0A <infile> <outfile> <new_top_line> <new_left_sample>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([235 x i8], [235 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0AUsage:\0A %s\0A\0A\00"
@.str.1 = [235 x i8] c"trim [-log <logfile>] [-height height] [-width width] \0A [-to <metadata file>] [-license] [-version] [-help]\0A [-lat1 <lat> -lat2 <lat> -lon1 <lon> -lon2 <lon>]\0A <infile> <outfile> <new_top_line> <new_left_sample>\0A\00"
define void @usage() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([235 x i8], [235 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct pm_gpio {
  int dummy;
};

/* Variables and functions */
int ENXIO;
int pm8xxx_gpio_config(int gpio, struct pm_gpio *param) { return -ENXIO; }


x86 assembly (clang, -O0):
<pm8xxx_gpio_config>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm8xxx_gpio_config>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.pm_gpio = type { i32 }
@ENXIO = global i32 0
define i32 @pm8xxx_gpio_config(i32 %0, %struct.pm_gpio* %1) {
%3 = alloca i32
%4 = alloca %struct.pm_gpio*
store i32 %0, i32* %3
store %struct.pm_gpio* %1, %struct.pm_gpio** %4
%5 = load i32, i32* @ENXIO
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.pm_gpio = type { i32 }
@ENXIO = global i32 0
define i32 @pm8xxx_gpio_config(i32 %0, %struct.pm_gpio* nocapture readnone %1) {
%3 = load i32, i32* @ENXIO
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
void pc(int c) { putchar(c); }


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

x86 assembly (clang, -O2):
<pc>:
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @pc(i32 %0) {
%2 = tail call i32 @putchar(i32 %0)
ret void
}
void exit() {
  asm("movl $42, %ebx\n\t"
      "movl $1, %eax\n\t"
      "int $0x80\n\t");
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x2a,%ebx
mov    $0x1,%eax
int    $0x80

x86 assembly (clang, -O2):
<exit>:
mov    $0x2a,%ebx
mov    $0x1,%eax
int    $0x80

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

LLVM IR (-O2):
define void @exit(i32 %0) {
tail call void asm sideeffect "movl $$42, %ebx\0A\09movl $$1, %eax\0A\09int $$0x80\0A\09", "~{dirflag},~{fpsr},~{flags}"()
unreachable
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t reverse(uint8_t b) {
  uint8_t r = 0;
  int i;
  for (i = 0; i < 8; i++) {
    r <<= 1;
    r |= b & 0x1;
    b >>= 1;
  }
  return r;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    114b <reverse+0x4b>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <reverse+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %al,%dil
mov    %edi,%eax
and    $0x55,%al
add    %al,%al
shr    %dil
and    $0x55,%dil
or     %al,%dil
movzbl %dil,%eax
ret

LLVM IR (-O0):
define i32 @reverse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32, i32* %3
%10 = shl i32 %9, 1
store i32 %10, i32* %3
%11 = load i32, i32* %2
%12 = and i32 %11, 1
%13 = load i32, i32* %3
%14 = or i32 %13, %12
store i32 %14, i32* %3
%15 = load i32, i32* %2
%16 = ashr i32 %15, 1
store i32 %16, i32* %2
br label %17
17: ; preds = %8
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = call i8 @llvm.bitreverse.i8(i8 %2)
%4 = zext i8 %3 to i32
ret i32 %4
}