xunge/DecIR huggingface dataset:
void swap(int *data, int a, int b) {
  int temp;
  temp = data[a];
  data[a] = data[b];
  data[b] = temp;
}


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

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

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
unsigned short d_getuw(const unsigned char *ptr) {
  return (((unsigned short)ptr[0] << 8) | ((unsigned short)ptr[1] << 0));
}


x86 assembly (clang, -O0):
<d_getuw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzwl %ax,%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
movzwl %cx,%ecx
shl    $0x0,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_getuw>:
movzwl (%rdi),%eax
rol    $0x8,%ax
ret

LLVM IR (-O0):
define zeroext i16 @d_getuw(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = zext i8 %5 to i16
%7 = zext i16 %6 to i32
%8 = shl i32 %7, 8
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i16
%13 = zext i16 %12 to i32
%14 = shl i32 %13, 0
%15 = or i32 %8, %14
%16 = trunc i32 %15 to i16
ret i16 %16
}

LLVM IR (-O2):
define zeroext i16 @d_getuw(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i16
%4 = shl nuw i16 %3, 8
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = zext i8 %6 to i16
%8 = or i16 %4, %7
ret i16 %8
}
/* Type definitions */
struct file_state {
  int dummy;
};

/* Variables and functions */
scalar_t__ digitp(int /*<<< orphan*/);
int /*<<< orphan*/ get_char(struct file_state *, char const *);
char *next_char(struct file_state *, char const *, int);
const char *after_digits(struct file_state *file, const char *ptr) {
  while (digitp(get_char(file, ptr))) {
    ptr = next_char(file, ptr, 1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<after_digits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <get_char@plt>
mov    %eax,%edi
call   1040 <digitp@plt>
cmp    $0x0,%rax
je     1179 <after_digits+0x49>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <next_char@plt>
mov    %rax,-0x10(%rbp)
jmp    1140 <after_digits+0x10>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<after_digits>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
call   1050 <get_char@plt>
mov    %eax,%edi
call   1040 <digitp@plt>
test   %rax,%rax
je     116c <after_digits+0x3c>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <next_char@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
jmp    1140 <after_digits+0x10>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.file_state = type { i32 }
define i8* @after_digits(%struct.file_state* %0, i8* %1) {
%3 = alloca %struct.file_state*
%4 = alloca i8*
store %struct.file_state* %0, %struct.file_state** %3
store i8* %1, i8** %4
br label %5
5: ; preds = %11, %2
%6 = load %struct.file_state*, %struct.file_state** %3
%7 = load i8*, i8** %4
%8 = call i32 @get_char(%struct.file_state* %6, i8* %7)
%9 = call i64 @digitp(i32 %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %5
%12 = load %struct.file_state*, %struct.file_state** %3
%13 = load i8*, i8** %4
%14 = call i8* @next_char(%struct.file_state* %12, i8* %13, i32 1)
store i8* %14, i8** %4
br label %5
15: ; preds = %5
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
%struct.file_state = type { i32 }
define i8* @after_digits(%struct.file_state* %0, i8* %1) {
%3 = tail call i32 @get_char(%struct.file_state* %0, i8* %1)
%4 = tail call i64 @digitp(i32 %3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %8, %6 ], [ %1, %2 ]
%8 = tail call i8* @next_char(%struct.file_state* %0, i8* %7, i32 1)
%9 = tail call i32 @get_char(%struct.file_state* %0, i8* %8)
%10 = tail call i64 @digitp(i32 %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %2
%13 = phi i8* [ %1, %2 ], [ %8, %6 ]
ret i8* %13
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
int strlen(char *);
void _copy_string(char *dst, char *src, uint32_t maxlen) {
  int nchars;
  int srclen;
  srclen = strlen(src);
  nchars = (srclen > maxlen) ? maxlen : srclen;
  memcpy(dst, src, nchars);
  dst[nchars - 1] = '\0';
}


x86 assembly (clang, -O0):
<_copy_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    1156 <_copy_string+0x36>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    115c <_copy_string+0x3c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_copy_string>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %rsi,%r14
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
cmp    %ebx,%eax
cmovg  %ebx,%ebp
mov    %r15,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1040 <memcpy@plt>
movslq %ebp,%rax
movb   $0x0,-0x1(%rax,%r15,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @_copy_string(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%9 = load i8*, i8** %5
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %8
%11 = load i32, i32* %8
%12 = load i32, i32* %6
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %3
%15 = load i32, i32* %6
br label %18
16: ; preds = %3
%17 = load i32, i32* %8
br label %18
18: ; preds = %16, %14
%19 = phi i32 [ %15, %14 ], [ %17, %16 ]
store i32 %19, i32* %7
%20 = load i8*, i8** %4
%21 = load i8*, i8** %5
%22 = load i32, i32* %7
%23 = call i32 @memcpy(i8* %20, i8* %21, i32 %22)
%24 = load i8*, i8** %4
%25 = load i32, i32* %7
%26 = sub nsw i32 %25, 1
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %24, i64 %27
store i8 0, i8* %28
ret void
}

LLVM IR (-O2):
define void @_copy_string(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @strlen(i8* %1)
%5 = icmp sgt i32 %4, %2
%6 = select i1 %5, i32 %2, i32 %4
%7 = tail call i32 @memcpy(i8* %0, i8* %1, i32 %6)
%8 = add nsw i32 %6, -1
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
store i8 0, i8* %10
ret void
}
unsigned hexval(char c) {
  return c <= '9' ? c - '9' : c <= 'F' ? c - 'A' + 10 : c - 'a' + 10;
}


x86 assembly (clang, -O0):
<hexval>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jg     1126 <hexval+0x26>
movsbl -0x1(%rbp),%eax
sub    $0x39,%eax
mov    %eax,-0x8(%rbp)
jmp    1158 <hexval+0x58>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
jg     1145 <hexval+0x45>
movsbl -0x1(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <hexval+0x52>
movsbl -0x1(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexval>:
xor    %ecx,%ecx
cmp    $0x47,%dil
setb   %cl
shl    $0x5,%ecx
add    $0xffffffa9,%ecx
cmp    $0x3a,%dil
mov    $0xffffffc7,%eax
cmovge %ecx,%eax
add    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @hexval(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = icmp slt i8 %0, 58
%4 = icmp ult i8 %0, 71
%5 = select i1 %4, i32 -55, i32 -87
%6 = select i1 %3, i32 -57, i32 %5
%7 = add nsw i32 %6, %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int stub1();
int stub2();
void print(int i, int (*fn1)()) { printf("%d\n", (*fn1)()); }


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   *-0x10(%rbp)
mov    %eax,%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rax
xor    %eax,%eax
call   *%rsi
lea    0xee4(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @print(i32 %0, i32 (...)* nocapture %1) {
%3 = tail call i32 (...) %1()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
int dns_cache_check(struct dns_cache *cache __attribute__((unused))) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.dns_cache = type opaque
define i32 @dns_cache_check(%struct.dns_cache* nocapture readnone %0) {
ret i32 0
}
void hop() {
  asm volatile("popq %%rax\n\t"
               "call _nexthop\n\t"
               "_nexthop:popq %%rbx\n\t"
               "add %%rbx, %%rax\n\t"
               "jmp *%%rax\n\t" ::
                   :);
}


x86 assembly (clang, -O0):
<hop>:
push   %rbp
mov    %rsp,%rbp
pop    %rax
call   110a <_nexthop>

x86 assembly (clang, -O2):
<hop>:
pop    %rax
call   1106 <_nexthop>

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

LLVM IR (-O2):
define void @hop() {
tail call void asm sideeffect "popq %rax\0A\09call _nexthop\0A\09_nexthop:popq %rbx\0A\09add %rbx, %rax\0A\09jmp *%rax\0A\09", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
int cairo_code_draw_envThresholdLabel_get_width() { return 7; }


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

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

LLVM IR (-O0):
define i32 @cairo_code_draw_envThresholdLabel_get_width() {
ret i32 7
}

LLVM IR (-O2):
define i32 @cairo_code_draw_envThresholdLabel_get_width() {
ret i32 7
}
int IS_EQUAL_STRING(char *s1, char *s2) {
  for (; *s1 == *s2; *s1++, *s2++)
    if (*s1 == '\0' && *s2 == '\0')
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<IS_EQUAL_STRING>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1170 <IS_EQUAL_STRING+0x70>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114e <IS_EQUAL_STRING+0x4e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    114e <IS_EQUAL_STRING+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    1177 <IS_EQUAL_STRING+0x77>
jmp    1153 <IS_EQUAL_STRING+0x53>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <IS_EQUAL_STRING+0xc>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IS_EQUAL_STRING>:
mov    (%rdi),%cl
xor    %eax,%eax
cmp    (%rsi),%cl
jne    1124 <IS_EQUAL_STRING+0x24>
mov    $0x1,%edx
nopl   (%rax)
test   %cl,%cl
je     1125 <IS_EQUAL_STRING+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <IS_EQUAL_STRING+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @IS_EQUAL_STRING(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %6, %11, %2
%18 = phi i32 [ 0, %2 ], [ 0, %11 ], [ 1, %6 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char);
void _myStop() {
  char temp;
  printf("input a char and enter:\n");
  scanf(temp);
}


x86 assembly (clang, -O0):
<_myStop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x1(%rbp),%edi
call   1040 <scanf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_myStop>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <scanf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"input a char and enter:\0A\00"
define void @_myStop() {
%1 = alloca i8
%2 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%3 = load i8, i8* %1
%4 = call i32 @scanf(i8 signext %3)
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"input a char and enter:\00"
define void @_myStop() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @scanf(i8 signext undef)
ret void
}
int test_imm_A8int32_mem(int *val) {
  return ((*val) & (0xA8 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A8int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 168
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ *fdopendir(int);
DIR *xfdopendir(int fd) {
  DIR *d = fdopendir(fd);
  if (d == NULL) {
    ;
  }
  return d;
}


x86 assembly (clang, -O0):
<xfdopendir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <fdopendir@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1137 <xfdopendir+0x27>
jmp    1137 <xfdopendir+0x27>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xfdopendir>:
jmp    1030 <fdopendir@plt>

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

LLVM IR (-O2):
define i32* @xfdopendir(i32 %0) {
%2 = tail call i32* @fdopendir(i32 %0)
ret i32* %2
}
/* Variables and functions */
int ExtMcd(int, int);
int Mcd(int num1, int num2) {
  int aux_num;
  if (num1 > num2) {
    aux_num = num1;
    num1 = num2;
    num2 = aux_num;
  }
  return ExtMcd(num1, num2);
}


x86 assembly (clang, -O0):
<Mcd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    113c <Mcd+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <ExtMcd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mcd>:
cmp    %esi,%edi
mov    %esi,%eax
cmovg  %edi,%eax
cmovg  %esi,%edi
mov    %eax,%esi
jmp    1030 <ExtMcd@plt>

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

LLVM IR (-O2):
define i32 @Mcd(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
%6 = tail call i32 @ExtMcd(i32 %5, i32 %4)
ret i32 %6
}
int hash(int n) {
  int k;
  k = n % 10;
  return (k);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = srem i32 %0, 10
ret i32 %2
}
/* Variables and functions */
scalar_t__ isblank(char);
char *rm_space(char *s) {
  while (isblank(s[0]) != 0)
    s++;
  return s;
}


x86 assembly (clang, -O0):
<rm_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isblank@plt>
cmp    $0x0,%rax
je     1143 <rm_space+0x33>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <rm_space+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rm_space>:
push   %rbx
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isblank@plt>
test   %rax,%rax
jne    1120 <rm_space+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @rm_space(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %9, %1
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = call i64 @isblank(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %2
br label %3
12: ; preds = %3
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
define i8* @rm_space(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isblank(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i8* %3
}
int is_root_dir(const char *path) {
  return (path[0] == '/' && path[1] == '\0');
}


x86 assembly (clang, -O0):
<is_root_dir>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x2f,%ecx
mov    %al,-0x9(%rbp)
jne    112e <is_root_dir+0x2e>
mov    -0x8(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_root_dir>:
xor    %eax,%eax
cmpb   $0x2f,(%rdi)
jne    1110 <is_root_dir+0x10>
xor    %eax,%eax
cmpb   $0x0,0x1(%rdi)
sete   %al
ret

LLVM IR (-O0):
define i32 @is_root_dir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 47
br i1 %7, label %8, label %14
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %8, %1
%15 = phi i1 [ false, %1 ], [ %13, %8 ]
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @is_root_dir(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 47
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %4, %1
%10 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %10
}
void COMstart() {}


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

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

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

LLVM IR (-O2):
define void @COMstart() {
ret void
}
/* Variables and functions */
scalar_t__ floor(float);
float rintf(float x) {
  return ((x < (float)0.) ? -(float)floor(-x + .5) : (float)floor(x + .5));
}


x86 assembly (clang, -O0):
<rintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1171 <rintf+0x61>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <floor@plt>
cvtsi2ss %rax,%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1199 <rintf+0x89>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe7e(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <floor@plt>
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rintf>:
push   %rax
xorps  %xmm1,%xmm1
ucomiss %xmm0,%xmm1
jbe    113e <rintf+0x2e>
movss  0xedf(%rip),%xmm1
subss  %xmm0,%xmm1
movaps %xmm1,%xmm0
call   1030 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
xorps  0xed4(%rip),%xmm0
pop    %rax
ret
addss  0xeba(%rip),%xmm0
call   1030 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rintf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load float, float* %2
%7 = fneg float %6
%8 = fpext float %7 to double
%9 = fadd double %8, 5.000000e-01
%10 = fptrunc double %9 to float
%11 = call i64 @floor(float %10)
%12 = sitofp i64 %11 to float
%13 = fneg float %12
br label %21
14: ; preds = %1
%15 = load float, float* %2
%16 = fpext float %15 to double
%17 = fadd double %16, 5.000000e-01
%18 = fptrunc double %17 to float
%19 = call i64 @floor(float %18)
%20 = sitofp i64 %19 to float
br label %21
21: ; preds = %14, %5
%22 = phi float [ %13, %5 ], [ %20, %14 ]
ret float %22
}

LLVM IR (-O2):
define float @rintf(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = fsub float 5.000000e-01, %0
%5 = tail call i64 @floor(float %4)
%6 = sitofp i64 %5 to float
%7 = fneg float %6
br label %12
8: ; preds = %1
%9 = fadd float %0, 5.000000e-01
%10 = tail call i64 @floor(float %9)
%11 = sitofp i64 %10 to float
br label %12
12: ; preds = %8, %3
%13 = phi float [ %7, %3 ], [ %11, %8 ]
ret float %13
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
void write_to_file(FILE *fp, char *message) {
  fprintf(fp, "%s\n", message);
  fflush(fp);
}


x86 assembly (clang, -O0):
<write_to_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_to_file>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xed2(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @write_to_file(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 @fprintf(i32* %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32*, i32** %3
%9 = call i32 @fflush(i32* %8)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @write_to_file(i32* nocapture %0, i8* %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @fflush(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _IO(int, int);
scalar_t__ ioctl(int, int /*<<< orphan*/, int *);
int blkdev_get_sector_size(int fd, int *sector_size) {
  if (ioctl(fd, _IO(0x12, 104), sector_size) >= 0)
    return 0;
  return -1;
}


x86 assembly (clang, -O0):
<blkdev_get_sector_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    $0x12,%edi
mov    $0x68,%esi
call   1030 <_IO@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1040 <ioctl@plt>
cmp    $0x0,%rax
jl     1168 <blkdev_get_sector_size+0x48>
movl   $0x0,-0x4(%rbp)
jmp    116f <blkdev_get_sector_size+0x4f>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blkdev_get_sector_size>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x12,%edi
mov    $0x68,%esi
call   1030 <_IO@plt>
mov    %ebp,%edi
mov    %eax,%esi
mov    %rbx,%rdx
call   1040 <ioctl@plt>
sar    $0x3f,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @blkdev_get_sector_size(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 = call i32 @_IO(i32 18, i32 104)
%8 = load i32*, i32** %5
%9 = call i64 @ioctl(i32 %6, i32 %7, i32* %8)
%10 = icmp sge i64 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %13
12: ; preds = %2
store i32 -1, i32* %3
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @blkdev_get_sector_size(i32 %0, i32* %1) {
%3 = tail call i32 @_IO(i32 18, i32 104)
%4 = tail call i64 @ioctl(i32 %0, i32 %3, i32* %1)
%5 = ashr i64 %4, 63
%6 = trunc i64 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ nl_item;

/* Variables and functions */
int /*<<< orphan*/ nl_langinfo(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char const *, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int _langinfo(char const *progname, nl_item item) {
  printf("%s: nl_langinfo(%lu) returns \"%s\"\n", progname, item,
         nl_langinfo(item));
  return 0;
}


x86 assembly (clang, -O0):
<_langinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <nl_langinfo@plt>
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_langinfo>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <nl_langinfo@plt>
lea    0xec9(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [35 x i8] c"%s: nl_langinfo(%lu) returns \22%s\22\0A\00"
define i32 @_langinfo(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 = load i32, i32* %4
%8 = call i32 @nl_langinfo(i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [35 x i8] c"%s: nl_langinfo(%lu) returns \22%s\22\0A\00"
define i32 @_langinfo(i8* %0, i32 %1) {
%3 = tail call i32 @nl_langinfo(i32 %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1, i32 %3)
ret i32 0
}
/* Variables and functions */
int array_min_index_from_one(int *, int);
void call_array_min_index_from_one_good() {
  int a[2];
  a[array_min_index_from_one(a, 2) - 1] = 0;
}


x86 assembly (clang, -O0):
<call_array_min_index_from_one_good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
mov    $0x2,%esi
call   1030 <array_min_index_from_one@plt>
sub    $0x1,%eax
cltq
movl   $0x0,-0x8(%rbp,%rax,4)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_array_min_index_from_one_good>:
push   %rax
mov    %rsp,%rdi
mov    $0x2,%esi
call   1030 <array_min_index_from_one@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @call_array_min_index_from_one_good() {
%1 = alloca [2 x i32]
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%3 = call i32 @array_min_index_from_one(i32* %2, i32 2)
%4 = sub nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 %5
store i32 0, i32* %6
ret void
}

LLVM IR (-O2):
define void @call_array_min_index_from_one_good() {
%1 = alloca [2 x i32]
%2 = bitcast [2 x i32]* %1 to i8*
%3 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%4 = call i32 @array_min_index_from_one(i32* %3, i32 2)
ret void
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_del(struct list_head *);
int /*<<< orphan*/ list_init(struct list_head *);
void list_del_init(struct list_head *elem) {
  list_del(elem);
  list_init(elem);
}


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

x86 assembly (clang, -O2):
<list_del_init>:
push   %rbx
mov    %rdi,%rbx
call   1030 <list_del@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <list_init@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_del_init(%struct.list_head* %0) {
%2 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %2
%3 = load %struct.list_head*, %struct.list_head** %2
%4 = call i32 @list_del(%struct.list_head* %3)
%5 = load %struct.list_head*, %struct.list_head** %2
%6 = call i32 @list_init(%struct.list_head* %5)
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_del_init(%struct.list_head* %0) {
%2 = tail call i32 @list_del(%struct.list_head* %0)
%3 = tail call i32 @list_init(%struct.list_head* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
void *malloc(size_t);
void *mem_malloc(size_t size) {
  void *p = malloc(size);
  if (!p)
    error("memory allocation failed (no memory left?) [mem_malloc]\n");
  return p;
}


x86 assembly (clang, -O0):
<mem_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1150 <mem_malloc+0x30>
lea    0xeb5(%rip),%rdi
call   1040 <error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_malloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <mem_malloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [57 x i8] c"memory allocation failed (no memory left?) [mem_malloc]\0A\00"
define i8* @mem_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @error(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [57 x i8] c"memory allocation failed (no memory left?) [mem_malloc]\0A\00"
define noalias i8* @mem_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @error(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int g(int, int, int);
int __attribute__((no)) bar(void) { return g(1, 2, 3); }


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <g@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
jmp    1030 <g@plt>

LLVM IR (-O0):
define i32 @bar() {
%1 = call i32 @g(i32 1, i32 2, i32 3)
ret i32 %1
}

LLVM IR (-O2):
define i32 @bar() {
%1 = tail call i32 @g(i32 1, i32 2, i32 3)
ret i32 %1
}
int main() {
  int i, j;
  if (i == 1) {
    printf("1\n");
    while (i < 10) {
      if (i == 2)
        goto next;
    }
    printf("2\n");
    __asm__("ret");
  }
  while (j < 15) {
  next:
    printf("3\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1164 <main+0x54>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xa,-0x8(%rbp)
jge    1155 <main+0x45>
cmpl   $0x2,-0x8(%rbp)
jne    1150 <main+0x40>
jmp    1178 <main+0x68>
jmp    1137 <main+0x27>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
ret
jmp    1169 <main+0x59>
cmpl   $0xf,-0xc(%rbp)
jge    118b <main+0x7b>
jmp    1178 <main+0x68>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1169 <main+0x59>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
long ndb_free(void *m_ptr) {
  free(m_ptr);
  return 0;
}


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

x86 assembly (clang, -O2):
<ndb_free>:
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i64 @ndb_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i64 0
}
/* Variables and functions */
int /*<<< orphan*/ Delay10TCYx(unsigned char);
void Delay100TCYx(unsigned char unit) {
  int i;
  for (i = 0; i < 10; i++) {
    Delay10TCYx(unit);
  }
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1146 <Delay100TCYx+0x36>
movzbl -0x1(%rbp),%edi
call   1030 <Delay10TCYx@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <Delay100TCYx+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
push   %rbx
mov    %edi,%ebx
call   1030 <Delay10TCYx@plt>
mov    %ebx,%edi
call   1030 <Delay10TCYx@plt>
mov    %ebx,%edi
call   1030 <Delay10TCYx@plt>
mov    %ebx,%edi
call   1030 <Delay10TCYx@plt>
mov    %ebx,%edi
call   1030 <Delay10TCYx@plt>
mov    %ebx,%edi
call   1030 <Delay10TCYx@plt>
mov    %ebx,%edi
call   1030 <Delay10TCYx@plt>
mov    %ebx,%edi
call   1030 <Delay10TCYx@plt>
mov    %ebx,%edi
call   1030 <Delay10TCYx@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <Delay10TCYx@plt>

LLVM IR (-O0):
define void @Delay100TCYx(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = load i8, i8* %2
%9 = call i32 @Delay10TCYx(i8 zeroext %8)
br label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @Delay100TCYx(i8 zeroext %0) {
%2 = tail call i32 @Delay10TCYx(i8 zeroext %0)
%3 = tail call i32 @Delay10TCYx(i8 zeroext %0)
%4 = tail call i32 @Delay10TCYx(i8 zeroext %0)
%5 = tail call i32 @Delay10TCYx(i8 zeroext %0)
%6 = tail call i32 @Delay10TCYx(i8 zeroext %0)
%7 = tail call i32 @Delay10TCYx(i8 zeroext %0)
%8 = tail call i32 @Delay10TCYx(i8 zeroext %0)
%9 = tail call i32 @Delay10TCYx(i8 zeroext %0)
%10 = tail call i32 @Delay10TCYx(i8 zeroext %0)
%11 = tail call i32 @Delay10TCYx(i8 zeroext %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_OpcodeArgumentMustBeConstant(long p_position) {
  _Error(p_position, "Opcode argument must be a literal expression");
}


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

x86 assembly (clang, -O2):
<Error_OpcodeArgumentMustBeConstant>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Opcode argument must be a literal expression\00"
define void @Error_OpcodeArgumentMustBeConstant(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Opcode argument must be a literal expression\00"
define void @Error_OpcodeArgumentMustBeConstant(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}
void avcodec_alloc_context3() {}


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

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

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

LLVM IR (-O2):
define void @avcodec_alloc_context3() {
ret void
}
const char *eraSofaVersion(void) { return "20170420"; }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"20170420\00"
define i8* @eraSofaVersion() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
signed long int signedlongint_ignoring_longlongint(signed long int x,
                                                   long long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlongint_ignoring_longlongint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @signedlongint_ignoring_longlongint(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlongint_ignoring_longlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
char *scout_h16(char const *);
char const *scout_ipv6address_rh2(char const *);
const char *scout_ipv6address_rh3(const char *c) {
  if ((c = scout_h16(c)) == NULL)
    return NULL;
  if (*(c + 1) == ':')
    return scout_ipv6address_rh2(c + 2);
  return NULL;
}


x86 assembly (clang, -O0):
<scout_ipv6address_rh3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <scout_h16@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1150 <scout_ipv6address_rh3+0x30>
movq   $0x0,-0x8(%rbp)
jmp    117f <scout_ipv6address_rh3+0x5f>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x3a,%eax
jne    1177 <scout_ipv6address_rh3+0x57>
mov    -0x10(%rbp),%rdi
add    $0x2,%rdi
call   1040 <scout_ipv6address_rh2@plt>
mov    %rax,-0x8(%rbp)
jmp    117f <scout_ipv6address_rh3+0x5f>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scout_ipv6address_rh3>:
push   %rax
call   1030 <scout_h16@plt>
test   %rax,%rax
je     113e <scout_ipv6address_rh3+0x1e>
cmpb   $0x3a,0x1(%rax)
jne    113e <scout_ipv6address_rh3+0x1e>
add    $0x2,%rax
mov    %rax,%rdi
pop    %rax
jmp    1040 <scout_ipv6address_rh2@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @scout_ipv6address_rh3(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i8* @scout_h16(i8* %4)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i8* null, i8** %2
br label %19
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 58
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 2
%17 = call i8* @scout_ipv6address_rh2(i8* %16)
store i8* %17, i8** %2
br label %19
18: ; preds = %8
store i8* null, i8** %2
br label %19
19: ; preds = %18, %14, %7
%20 = load i8*, i8** %2
ret i8* %20
}

LLVM IR (-O2):
define i8* @scout_ipv6address_rh3(i8* %0) {
%2 = tail call i8* @scout_h16(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 58
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = getelementptr inbounds i8, i8* %2, i64 2
%10 = tail call i8* @scout_ipv6address_rh2(i8* %9)
br label %11
11: ; preds = %4, %1, %8
%12 = phi i8* [ %10, %8 ], [ null, %1 ], [ null, %4 ]
ret i8* %12
}