xunge/DecIR huggingface dataset:
int ORD(char c) { return (int)c; }


x86 assembly (clang, -O0):
<ORD>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ORD(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @ORD(i8 signext %0) {
%2 = sext i8 %0 to i32
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int cmp(const void *x, const void *y) {
  uint64_t a = *(uint64_t *)x;
  uint64_t b = *(uint64_t *)y;
  if (a == b)
    return 0;
  if (a < b)
    return -1;
  return 1;
}


x86 assembly (clang, -O0):
<cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    113c <cmp+0x3c>
movl   $0x0,-0x4(%rbp)
jmp    115d <cmp+0x5d>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jge    1156 <cmp+0x56>
movl   $0xffffffff,-0x4(%rbp)
jmp    115d <cmp+0x5d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp>:
mov    (%rdi),%rax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%rax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = icmp slt i64 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
int get_index_from_code(char ch) {
  if (ch >= '0' && ch <= '9')
    return ch - '0';
  else if (ch >= 'A' && ch <= 'Z')
    return ch - 'A' + 10;
  else
    return ch - 'a' + 36;
}


x86 assembly (clang, -O0):
<get_index_from_code>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <get_index_from_code+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <get_index_from_code+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    116c <get_index_from_code+0x6c>
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     115f <get_index_from_code+0x5f>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     115f <get_index_from_code+0x5f>
movsbl -0x5(%rbp),%eax
sub    $0x41,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    116c <get_index_from_code+0x6c>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0x24,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_index_from_code>:
lea    -0x30(%rdi),%eax
lea    -0x41(%rdi),%ecx
cmp    $0x1a,%cl
mov    $0xffffffc9,%ecx
mov    $0xffffffc3,%edx
cmovb  %ecx,%edx
cmp    $0xa,%al
mov    $0xffffffd0,%eax
cmovae %edx,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_index_from_code(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %33
15: ; preds = %7, %1
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sge i32 %17, 65
br i1 %18, label %19, label %28
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sle i32 %21, 90
br i1 %22, label %23, label %28
23: ; preds = %19
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = sub nsw i32 %25, 65
%27 = add nsw i32 %26, 10
store i32 %27, i32* %2
br label %33
28: ; preds = %19, %15
%29 = load i8, i8* %3
%30 = sext i8 %29 to i32
%31 = sub nsw i32 %30, 97
%32 = add nsw i32 %31, 36
store i32 %32, i32* %2
br label %33
33: ; preds = %28, %23, %11
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @get_index_from_code(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add i8 %0, -48
%4 = icmp ult i8 %3, 10
%5 = add i8 %0, -65
%6 = icmp ult i8 %5, 26
%7 = select i1 %6, i32 -55, i32 -61
%8 = select i1 %4, i32 -48, i32 %7
%9 = add nsw i32 %8, %2
ret i32 %9
}
unsigned long prep_zero_mask(unsigned long a, unsigned long bits,
                             const struct word_at_a_time *c) {
  return bits;
}


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

x86 assembly (clang, -O2):
<prep_zero_mask>:
mov    %rsi,%rax
ret

LLVM IR (-O0):
%struct.word_at_a_time = type opaque
define i64 @prep_zero_mask(i64 %0, i64 %1, %struct.word_at_a_time* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca %struct.word_at_a_time*
store i64 %0, i64* %4
store i64 %1, i64* %5
store %struct.word_at_a_time* %2, %struct.word_at_a_time** %6
%7 = load i64, i64* %5
ret i64 %7
}

LLVM IR (-O2):
%struct.word_at_a_time = type opaque
define i64 @prep_zero_mask(i64 %0, i64 returned %1, %struct.word_at_a_time* nocapture readnone %2) {
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void dfg_free(void *ptr) { free((char *)ptr); }


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

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

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

LLVM IR (-O2):
define void @dfg_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
int hexdigit(char c) {
  if (c >= '0' && c <= '9')
    return c - '0';
  c |= 0x20;
  if (c >= 'a' && c <= 'f')
    return c - 'a' + 10;
  return -1;
}


x86 assembly (clang, -O0):
<hexdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <hexdigit+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x39,%eax
jg     1133 <hexdigit+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <hexdigit+0x70>
movsbl -0x5(%rbp),%eax
or     $0x20,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1169 <hexdigit+0x69>
movsbl -0x5(%rbp),%eax
cmp    $0x66,%eax
jg     1169 <hexdigit+0x69>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
add    $0xa,%eax
mov    %eax,-0x4(%rbp)
jmp    1170 <hexdigit+0x70>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdigit>:
lea    -0x30(%rdi),%eax
cmp    $0x9,%al
ja     110f <hexdigit+0xf>
movzbl %dil,%eax
add    $0xffffffd0,%eax
ret
or     $0x20,%dil
lea    -0x61(%rdi),%ecx
mov    $0xffffffff,%eax
cmp    $0x5,%cl
ja     1127 <hexdigit+0x27>
movzbl %dil,%eax
add    $0xffffffa9,%eax
ret

LLVM IR (-O0):
define i32 @hexdigit(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 57
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 48
store i32 %14, i32* %2
br label %33
15: ; preds = %7, %1
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = or i32 %17, 32
%19 = trunc i32 %18 to i8
store i8 %19, i8* %3
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp sge i32 %21, 97
br i1 %22, label %23, label %32
23: ; preds = %15
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 102
br i1 %26, label %27, label %32
27: ; preds = %23
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = sub nsw i32 %29, 97
%31 = add nsw i32 %30, 10
store i32 %31, i32* %2
br label %33
32: ; preds = %23, %15
store i32 -1, i32* %2
br label %33
33: ; preds = %32, %27, %11
%34 = load i32, i32* %2
ret i32 %34
}

LLVM IR (-O2):
define i32 @hexdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = zext i8 %0 to i32
%6 = add nsw i32 %5, -48
br label %14
7: ; preds = %1
%8 = or i8 %0, 32
%9 = add i8 %8, -97
%10 = icmp ult i8 %9, 6
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = zext i8 %8 to i32
%13 = add nsw i32 %12, -87
br label %14
14: ; preds = %7, %11, %4
%15 = phi i32 [ %6, %4 ], [ %13, %11 ], [ -1, %7 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ show_usage();
void show_help(void) {
  show_usage();
  printf("\n"
         "OPTIONS\n"
         "  -m <INTEGER>   Sets the maximum number of items allowed in any "
         "subset\n"
         "  -s <INTEGER>   Set the sum filter's required value\n"
         "\n"
         "  -a             Formats the output as an array \"[1, 2, 3]\"\n"
         "  -j             Similar to -a, but the output is valid JSON\n"
         "  -E             Skips the blank line representing the empty set\n"
         "\n"
         "  -h, --help     Show this help text\n"
         "  -V, --verison  Show the program version\n");
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <show_usage@plt>
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
push   %rax
xor    %eax,%eax
call   1040 <show_usage@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [402 x i8] c"\0AOPTIONS\0A -m <INTEGER> Sets the maximum number of items allowed in any subset\0A -s <INTEGER> Set the sum filter's required value\0A\0A -a Formats the output as an array \22[1, 2, 3]\22\0A -j Similar to -a, but the output is valid JSON\0A -E Skips the blank line representing the empty set\0A\0A -h, --help Show this help text\0A -V, --verison Show the program version\0A\00"
define void @show_help() {
%1 = call i32 (...) @show_usage()
%2 = call i32 @printf(i8* getelementptr inbounds ([402 x i8], [402 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [401 x i8] c"\0AOPTIONS\0A -m <INTEGER> Sets the maximum number of items allowed in any subset\0A -s <INTEGER> Set the sum filter's required value\0A\0A -a Formats the output as an array \22[1, 2, 3]\22\0A -j Similar to -a, but the output is valid JSON\0A -E Skips the blank line representing the empty set\0A\0A -h, --help Show this help text\0A -V, --verison Show the program version\00"
define void @show_help() {
%1 = tail call i32 (...) @show_usage()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([401 x i8], [401 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strncpy(char *, char *, int);
char *xstrncpy(char *des, char *src, int size) {
  char *result;
  result = strncpy(des, src, size - 1);
  des[size - 1] = 0;
  return result;
}


x86 assembly (clang, -O0):
<xstrncpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <strncpy@plt>
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrncpy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %edx,%rbx
lea    -0x1(%rbx),%rdx
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r14,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @xstrncpy(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 1
%12 = call i8* @strncpy(i8* %8, i8* %9, i32 %11)
store i8* %12, i8** %7
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %13, i64 %16
store i8 0, i8* %17
%18 = load i8*, i8** %7
ret i8* %18
}

LLVM IR (-O2):
define i8* @xstrncpy(i8* %0, i8* %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i8* @strncpy(i8* %0, i8* %1, i32 %4)
%6 = sext i32 %4 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
store i8 0, i8* %7
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ usleep(int);
void *thread_function(void *arg) {
  volatile unsigned int i = 1;
  while (i != 0)
    usleep(1);
}


x86 assembly (clang, -O0):
<thread_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x0,%eax
je     113e <thread_function+0x2e>
mov    $0x1,%edi
call   1030 <usleep@plt>
jmp    1123 <thread_function+0x13>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<thread_function>:
push   %rax
movl   $0x1,0x4(%rsp)
cmpl   $0x0,0x4(%rsp)
je     1131 <thread_function+0x21>
mov    $0x1,%edi
call   1030 <usleep@plt>
cmpl   $0x0,0x4(%rsp)
jne    1120 <thread_function+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i8* @thread_function(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store volatile i32 1, i32* %4
br label %5
5: ; preds = %8, %1
%6 = load volatile i32, i32* %4
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @usleep(i32 1)
br label %5
10: ; preds = %5
%11 = load i8*, i8** %2
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @thread_function(i8* nocapture readnone %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store volatile i32 1, i32* %2
%4 = load volatile i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1, %6
%7 = tail call i32 @usleep(i32 1)
%8 = load volatile i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6, %1
ret i8* undef
}
int dcbCleanupSize_x86_cdecl(const char *signature) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @dcbCleanupSize_x86_cdecl(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sqrt(int);
int main() {
  int a;
  sqrt(a);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 @sqrt(i32 %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @sqrt(i32 undef)
ret i32 0
}
/* Variables and functions */
int __strncasecmp(char const *, char const *, int /*<<< orphan*/);
int __strcasecmp(const char *a, const char *b) {
  return __strncasecmp(a, b, 0);
}


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

x86 assembly (clang, -O2):
<__strcasecmp>:
xor    %edx,%edx
jmp    1030 <__strncasecmp@plt>

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

LLVM IR (-O2):
define i32 @__strcasecmp(i8* %0, i8* %1) {
%3 = tail call i32 @__strncasecmp(i8* %0, i8* %1, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ CDC_Transmit_FS(char *, int);
int _write(int file, char *ptr, int len) { CDC_Transmit_FS(ptr, len); }


x86 assembly (clang, -O0):
<_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <CDC_Transmit_FS@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_write>:
mov    %rsi,%rdi
mov    %edx,%esi
jmp    1030 <CDC_Transmit_FS@plt>

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

LLVM IR (-O2):
define i32 @_write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @CDC_Transmit_FS(i8* %1, i32 %2)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ fegetenv(void *);
void get_fpu_state(void *state) { fegetenv(state); }


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

x86 assembly (clang, -O2):
<get_fpu_state>:
jmp    1030 <fegetenv@plt>

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

LLVM IR (-O2):
define void @get_fpu_state(i8* %0) {
%2 = tail call i32 @fegetenv(i8* %0)
ret void
}
void XtStringConversionWarning() {}


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

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

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

LLVM IR (-O2):
define void @XtStringConversionWarning() {
ret void
}
void NetworkDrawChatMessage() {}


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

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

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

LLVM IR (-O2):
define void @NetworkDrawChatMessage() {
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  double tv_usec;
  double tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
double getcurtime(void) {
  struct timeval tv;
  struct timezone tz;
  gettimeofday(&tv, &tz);
  return ((tv.tv_usec / 1000000.0) + (1.0 * tv.tv_sec));
}


x86 assembly (clang, -O0):
<getcurtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xece(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getcurtime>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
movsd  0x8(%rsp),%xmm0
divsd  0xed1(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
%struct.timezone = type { i32 }
define double @getcurtime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load double, double* %4
%6 = fdiv double %5, 1.000000e+06
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load double, double* %7
%9 = call double @llvm.fmuladd.f64(double 1.000000e+00, double %8, double %6)
ret double %9
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
%struct.timezone = type { i32 }
define double @getcurtime() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load double, double* %6
%8 = fdiv double %7, 1.000000e+06
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load double, double* %9
%11 = fadd double %10, %8
ret double %11
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M211_f(char *s) {
  debug("M211_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M211_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M211_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M211_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M211_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M211_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M211_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ afficherIntroduction();
int /*<<< orphan*/ printf(char *, int);
int saisirValeurNumerique();
int main(int argc, char **argv) {
  int nombre;
  afficherIntroduction();
  nombre = saisirValeurNumerique();
  printf("Le nombre saisi : %d\n\n", nombre);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <afficherIntroduction@plt>
mov    $0x0,%al
call   1040 <saisirValeurNumerique@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <afficherIntroduction@plt>
xor    %eax,%eax
call   1040 <saisirValeurNumerique@plt>
lea    0xeba(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Le nombre saisi : %d\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @afficherIntroduction()
%8 = call i32 (...) @saisirValeurNumerique()
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"Le nombre saisi : %d\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @afficherIntroduction()
%4 = tail call i32 (...) @saisirValeurNumerique()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ strlcpy(char *, char const *, size_t);
int strlen(char const *);
char *xmalloc(size_t);
__attribute__((visibility("hidden"))) char *xstrndup(const char *str,
                                                     size_t size) {
  size_t len;
  char *cp;
  len = strlen(str) + 1;
  if (size < len)
    len = size;
  cp = xmalloc(len);
  strlcpy(cp, str, len);
  return cp;
}


x86 assembly (clang, -O0):
<xstrndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1168 <xstrndup+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <strlcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r15
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%rbx
cmp    %r15,%rbx
cmova  %r15,%rbx
mov    %rbx,%rdi
call   1040 <xmalloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <strlcpy@plt>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define hidden i8* @xstrndup(i8* %0, i64 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, 1
%5 = sext i32 %4 to i64
%6 = icmp ugt i64 %5, %1
%7 = select i1 %6, i64 %1, i64 %5
%8 = tail call i8* @xmalloc(i64 %7)
%9 = tail call i32 @strlcpy(i8* %8, i8* %0, i64 %7)
ret i8* %8
}
/* Variables and functions */
double logf(int);
float atanhf(float x) { return 0.5 * logf((1 + x) / (1 - x)); }


x86 assembly (clang, -O0):
<atanhf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xee3(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  0xed6(%rip),%xmm1
subss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1030 <logf@plt>
movaps %xmm0,%xmm1
movsd  0xeb1(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atanhf>:
push   %rax
movss  0xee7(%rip),%xmm1
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
subss  %xmm0,%xmm1
divss  %xmm1,%xmm2
cvttss2si %xmm2,%edi
call   1030 <logf@plt>
mulsd  0xecf(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @atanhf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fadd float 1.000000e+00, %3
%5 = load float, float* %2
%6 = fsub float 1.000000e+00, %5
%7 = fdiv float %4, %6
%8 = fptosi float %7 to i32
%9 = call double @logf(i32 %8)
%10 = fmul double 5.000000e-01, %9
%11 = fptrunc double %10 to float
ret float %11
}

LLVM IR (-O2):
define float @atanhf(float %0) {
%2 = fadd float %0, 1.000000e+00
%3 = fsub float 1.000000e+00, %0
%4 = fdiv float %2, %3
%5 = fptosi float %4 to i32
%6 = tail call double @logf(i32 %5)
%7 = fmul double %6, 5.000000e-01
%8 = fptrunc double %7 to float
ret float %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ foo(int);
int main(void) {
  foo(2);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2,%edi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x2,%edi
call   1030 <foo@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i32 2)
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 2)
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void collosus() { printf("Where is Doctor Forbin?\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Where is Doctor Forbin?\0A\00"
define void @collosus() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Where is Doctor Forbin?\00"
define void @collosus() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
int my_showmem(char const *str, int size) { return (0); }


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

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

LLVM IR (-O0):
define i32 @my_showmem(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
ret i32 0
}

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

/* Variables and functions */
char *fgets(char *, int, int /*<<< orphan*/ *);
int strlen(char *);
char *getl(FILE *stream, char *line) {
  char *ret;
  ret = fgets(line, 1024, stream);
  line[strlen(line) - 1] = 0x00;
  return ret;
}


x86 assembly (clang, -O0):
<getl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x400,%esi
call   1040 <fgets@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getl>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rdx
mov    %rsi,%rdi
mov    $0x400,%esi
call   1040 <fgets@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @getl(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = load i32*, i32** %3
%8 = call i8* @fgets(i8* %6, i32 1024, i32* %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = sub nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %9, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %5
ret i8* %15
}

LLVM IR (-O2):
define i8* @getl(i32* nocapture %0, i8* %1) {
%3 = tail call i8* @fgets(i8* %1, i32 1024, i32* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add nsw i32 %4, -1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %1, i64 %6
store i8 0, i8* %7
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ _syscall(int, int, int /*<<< orphan*/, int /*<<< orphan*/);
void _exit(int status) { _syscall(1, status, 0, 0); }


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <_syscall@plt>

x86 assembly (clang, -O2):
<_exit>:
push   %rax
mov    %edi,%esi
mov    $0x1,%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <_syscall@plt>

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_syscall(i32 1, i32 %3, i32 0, i32 0)
unreachable
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
%2 = tail call i32 @_syscall(i32 1, i32 %0, i32 0, i32 0)
unreachable
}
int valid_bool(const int val) { return (val == 0 || val == 1); }


x86 assembly (clang, -O0):
<valid_bool>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <valid_bool+0x20>
cmpl   $0x1,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<valid_bool>:
xor    %eax,%eax
cmp    $0x2,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @valid_bool(i32 %0) {
%2 = icmp ult i32 %0, 2
%3 = zext i1 %2 to i32
ret i32 %3
}
int Lower(int c) { return (c >= 'A' && c <= 'Z') ? c + 'a' - 'A' : c; }


x86 assembly (clang, -O0):
<Lower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112c <Lower+0x2c>
cmpl   $0x5a,-0x4(%rbp)
jg     112c <Lower+0x2c>
mov    -0x4(%rbp),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <Lower+0x32>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Lower(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
void g_object_steal_qdata() {}


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

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

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

LLVM IR (-O2):
define void @g_object_steal_qdata() {
ret void
}
long long int fn5(long long int x, unsigned long y) { return x << y; }


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

x86 assembly (clang, -O2):
<fn5>:
mov    %rsi,%rcx
mov    %rdi,%rax
shl    %cl,%rax
ret

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

LLVM IR (-O2):
define i64 @fn5(i64 %0, i64 %1) {
%3 = shl i64 %0, %1
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ process_switch(int);
void process_yield() { process_switch(1); }


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

x86 assembly (clang, -O2):
<process_yield>:
mov    $0x1,%edi
jmp    1030 <process_switch@plt>

LLVM IR (-O0):
define void @process_yield() {
%1 = call i32 @process_switch(i32 1)
ret void
}

LLVM IR (-O2):
define void @process_yield() {
%1 = tail call i32 @process_switch(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_bit(int, void *);
int test_bit(int, void *);
int test_and_set_bit(int nr, void *addr) {
  int oldbit = test_bit(nr, addr);
  set_bit(nr, addr);
  return oldbit;
}


x86 assembly (clang, -O0):
<test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <test_bit@plt>
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <set_bit@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_and_set_bit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %edi,%ebp
call   1040 <test_bit@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %rbx,%rsi
call   1030 <set_bit@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @test_and_set_bit(i32 %0, i8* %1) {
%3 = tail call i32 @test_bit(i32 %0, i8* %1)
%4 = tail call i32 @set_bit(i32 %0, i8* %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void bl_next_nonstandard_i2c(void) {
  FILE *f;
  f = fopen("/sys/devices/platform/lf1000-dpc/"
            "backlight_next",
            "w");
  if (!f)
    return;
  fprintf(f, "%d", 1);
  fclose(f);
}


x86 assembly (clang, -O0):
<bl_next_nonstandard_i2c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xeea(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    115f <bl_next_nonstandard_i2c+0x2f>
jmp    117d <bl_next_nonstandard_i2c+0x4d>
mov    -0x8(%rbp),%rdi
lea    0xec8(%rip),%rsi
mov    $0x1,%edx
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bl_next_nonstandard_i2c>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xef1(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1169 <bl_next_nonstandard_i2c+0x39>
mov    %rax,%rbx
lea    0xedf(%rip),%rsi
mov    %rax,%rdi
mov    $0x1,%edx
call   1040 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fclose@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [48 x i8] c"/sys/devices/platform/lf1000-dpc/backlight_next\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"%d\00"
define void @bl_next_nonstandard_i2c() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = icmp ne i32* %3, null
br i1 %4, label %6, label %5
5: ; preds = %0
br label %11
6: ; preds = %0
%7 = load i32*, i32** %1
%8 = call i32 @fprintf(i32* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 1)
%9 = load i32*, i32** %1
%10 = call i32 @fclose(i32* %9)
br label %11
11: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"/sys/devices/platform/lf1000-dpc/backlight_next\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [3 x i8] c"%d\00"
define void @bl_next_nonstandard_i2c() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @fprintf(i32* %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 1)
%5 = tail call i32 @fclose(i32* %1)
br label %6
6: ; preds = %0, %3
ret void
}
long hcf(long x, long y) {
  long t;
  while (y != 0) {
    t = x % y;
    x = y;
    y = t;
  }
  return x;
}


x86 assembly (clang, -O0):
<hcf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113a <hcf+0x3a>
mov    -0x8(%rbp),%rax
cqto
idivq  -0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    110c <hcf+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hcf>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <hcf+0x35>
mov    %rsi,%rdx
jmp    111d <hcf+0x1d>
nopl   (%rax)
cqto
idiv   %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <hcf+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <hcf+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <hcf+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @hcf(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = srem i64 %5, %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %6, %4 ]
ret i64 %10
}
int print_sym(void *pointer) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @print_sym(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ gid_t;

/* Variables and functions */
int syscall(int, int /*<<< orphan*/);
int setfsgid(gid_t gid) { return syscall(216, gid); }


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

x86 assembly (clang, -O2):
<setfsgid>:
mov    %edi,%esi
mov    $0xd8,%edi
jmp    1030 <syscall@plt>

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

LLVM IR (-O2):
define i32 @setfsgid(i32 %0) {
%2 = tail call i32 @syscall(i32 216, i32 %0)
ret i32 %2
}
/* Type definitions */
struct vec4 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec4_clamp(float *, float *, float *, float *);
__attribute__((always_)) struct vec4 *psvec4_clamp(struct vec4 *result,
                                                   struct vec4 *a,
                                                   struct vec4 *lower,
                                                   struct vec4 *higher) {
  vec4_clamp((float *)result, (float *)a, (float *)lower, (float *)higher);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec4_clamp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec4_clamp@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec4 = type { i32 }
define %struct.vec4* @psvec4_clamp(%struct.vec4* %0, %struct.vec4* %1, %struct.vec4* %2, %struct.vec4* %3) {
%5 = alloca %struct.vec4*
%6 = alloca %struct.vec4*
%7 = alloca %struct.vec4*
%8 = alloca %struct.vec4*
store %struct.vec4* %0, %struct.vec4** %5
store %struct.vec4* %1, %struct.vec4** %6
store %struct.vec4* %2, %struct.vec4** %7
store %struct.vec4* %3, %struct.vec4** %8
%9 = load %struct.vec4*, %struct.vec4** %5
%10 = bitcast %struct.vec4* %9 to float*
%11 = load %struct.vec4*, %struct.vec4** %6
%12 = bitcast %struct.vec4* %11 to float*
%13 = load %struct.vec4*, %struct.vec4** %7
%14 = bitcast %struct.vec4* %13 to float*
%15 = load %struct.vec4*, %struct.vec4** %8
%16 = bitcast %struct.vec4* %15 to float*
%17 = call i32 @vec4_clamp(float* %10, float* %12, float* %14, float* %16)
%18 = load %struct.vec4*, %struct.vec4** %5
ret %struct.vec4* %18
}

LLVM IR (-O2):
%struct.vec4 = type { i32 }
define %struct.vec4* @psvec4_clamp(%struct.vec4* returned %0, %struct.vec4* %1, %struct.vec4* %2, %struct.vec4* %3) {
%5 = bitcast %struct.vec4* %0 to float*
%6 = bitcast %struct.vec4* %1 to float*
%7 = bitcast %struct.vec4* %2 to float*
%8 = bitcast %struct.vec4* %3 to float*
%9 = tail call i32 @vec4_clamp(float* %5, float* %6, float* %7, float* %8)
ret %struct.vec4* %0
}
/* Variables and functions */
int /*<<< orphan*/ io_text_line(char *);
void sylk_show_options() {
  io_text_line("File format: sylk  (Microsoft Multiplan interchange format)");
}


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

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

LLVM IR (-O0):
@.str = [60 x i8] c"File format: sylk (Microsoft Multiplan interchange format)\00"
define void @sylk_show_options() {
%1 = call i32 @io_text_line(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [60 x i8] c"File format: sylk (Microsoft Multiplan interchange format)\00"
define void @sylk_show_options() {
%1 = tail call i32 @io_text_line(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int, int);
const char *cJSON_Version(void) {
  static char version[15];
  sprintf(version, "%i.%i.%i", 1, 5, 2);
  return version;
}


x86 assembly (clang, -O0):
<cJSON_Version>:
push   %rbp
mov    %rsp,%rbp
lea    0x2f0e(%rip),%rdi
lea    0xede(%rip),%rsi
mov    $0x1,%edx
mov    $0x5,%ecx
mov    $0x2,%r8d
call   1030 <sprintf@plt>
lea    0x2eeb(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cJSON_Version>:
push   %rbx
lea    0x2f11(%rip),%rbx
lea    0xee1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
mov    $0x5,%ecx
mov    $0x2,%r8d
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = call i32 @sprintf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 5, i32 2)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}

LLVM IR (-O2):
@cJSON_Version.version = internal global [15 x i8] zeroinitializer
@.str = [9 x i8] c"%i.%i.%i\00"
define i8* @cJSON_Version() {
%1 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1, i32 5, i32 2)
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @cJSON_Version.version, i64 0, i64 0)
}