xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void resetColors(void) {
  printf("\033[0m");
  fflush(stdout);
}


x86 assembly (clang, -O0):
<resetColors>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetColors>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"\1B[0m\00"
@stdout = global i32 0
define void @resetColors() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"\1B[0m\00"
@stdout = global i32 0
define void @resetColors() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ kprintf(char *, int);
void isrHandle26() { kprintf("ISR %d.\n", 26); }


x86 assembly (clang, -O0):
<isrHandle26>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x1a,%esi
call   1030 <kprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<isrHandle26>:
lea    0xee9(%rip),%rdi
mov    $0x1a,%esi
jmp    1030 <kprintf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle26() {
%1 = call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 26)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ISR %d.\0A\00"
define void @isrHandle26() {
%1 = tail call i32 @kprintf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 26)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ VIM_SIF_I2cReadByte(int, unsigned char *);
unsigned char CheckId_GC306(void) {
  unsigned char temp1;
  VIM_SIF_I2cReadByte(0x00, &temp1);
  if (temp1 == 0x97) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<CheckId_GC306>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x2(%rbp),%rsi
call   1030 <VIM_SIF_I2cReadByte@plt>
movzbl -0x2(%rbp),%eax
cmp    $0x97,%eax
jne    113b <CheckId_GC306+0x2b>
movb   $0x1,-0x1(%rbp)
jmp    113f <CheckId_GC306+0x2f>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckId_GC306>:
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
call   1030 <VIM_SIF_I2cReadByte@plt>
cmpb   $0x97,0x7(%rsp)
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i8 @CheckId_GC306() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @VIM_SIF_I2cReadByte(i32 0, i8* %2)
%4 = load i8, i8* %2
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 151
br i1 %6, label %7, label %8
7: ; preds = %0
store i8 1, i8* %1
br label %9
8: ; preds = %0
store i8 0, i8* %1
br label %9
9: ; preds = %8, %7
%10 = load i8, i8* %1
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @CheckId_GC306() {
%1 = alloca i8
%2 = call i32 @VIM_SIF_I2cReadByte(i32 0, i8* %1)
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, -105
%5 = zext i1 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ __ebt_print_error(char *);
void ebt_check_option(unsigned int *flags, unsigned int mask) {
  if (*flags & mask)
    __ebt_print_error("Multiple use of same option not allowed");
  ;
  *flags |= mask;
}


x86 assembly (clang, -O0):
<ebt_check_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     113d <ebt_check_option+0x2d>
lea    0xec8(%rip),%rdi
call   1030 <__ebt_print_error@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
or     (%rax),%ecx
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ebt_check_option>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    (%rdi),%eax
test   %esi,%eax
je     112c <ebt_check_option+0x1c>
lea    0xedb(%rip),%rdi
call   1030 <__ebt_print_error@plt>
mov    (%rbx),%eax
or     %ebp,%eax
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"Multiple use of same option not allowed\00"
define void @ebt_check_option(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = and i32 %6, %7
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @__ebt_print_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %2
%13 = load i32, i32* %4
%14 = load i32*, i32** %3
%15 = load i32, i32* %14
%16 = or i32 %15, %13
store i32 %16, i32* %14
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Multiple use of same option not allowed\00"
define void @ebt_check_option(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = and i32 %3, %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = tail call i32 @__ebt_print_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %0
br label %9
9: ; preds = %6, %2
%10 = phi i32 [ %8, %6 ], [ %3, %2 ]
%11 = or i32 %10, %1
store i32 %11, i32* %0
ret void
}
/* Variables and functions */
scalar_t__ is_digit(char);
int is_num(char *s) {
  for (; is_digit(*s); s++)
    ;
  return *s == '\0' ? 1 : 0;
}


x86 assembly (clang, -O0):
<is_num>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <is_digit@plt>
cmp    $0x0,%rax
je     1148 <is_num+0x38>
jmp    1137 <is_num+0x27>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <is_num+0xc>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_num>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl (%rbx),%edi
call   1030 <is_digit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1120 <is_num+0x10>
xor    %eax,%eax
cmpb   $0x0,-0x1(%rbx)
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_num(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
br label %3
3: ; preds = %9, %1
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = call i64 @is_digit(i8 signext %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %3
br label %9
9: ; preds = %8
%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
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 1, i32 0
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_num(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @is_digit(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
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 0
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ sprintf2(char *, char *, char *, char *);
char *string_alloc(scalar_t__);
scalar_t__ string_length(char *);
char *smt_unary(char *opt, char *op) {
  char *string;
  string = string_alloc(1 + string_length(opt) + 1 + string_length(op) + 1);
  sprintf2(string, "(%s %s)", opt, op);
  return string;
}


x86 assembly (clang, -O0):
<smt_unary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <string_length@plt>
add    $0x1,%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <string_length@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   1030 <string_alloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe7b(%rip),%rsi
call   1050 <sprintf2@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smt_unary>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <string_length@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1040 <string_length@plt>
lea    (%r15,%rax,1),%rdi
add    $0x3,%rdi
call   1030 <string_alloc@plt>
mov    %rax,%rbx
lea    0xe9b(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <sprintf2@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"(%s %s)\00"
define i8* @smt_unary(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @string_length(i8* %6)
%8 = add nsw i64 1, %7
%9 = add nsw i64 %8, 1
%10 = load i8*, i8** %4
%11 = call i64 @string_length(i8* %10)
%12 = add nsw i64 %9, %11
%13 = add nsw i64 %12, 1
%14 = call i8* @string_alloc(i64 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32 @sprintf2(i8* %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %16, i8* %17)
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
@.str = [8 x i8] c"(%s %s)\00"
define i8* @smt_unary(i8* %0, i8* %1) {
%3 = tail call i64 @string_length(i8* %0)
%4 = tail call i64 @string_length(i8* %1)
%5 = add i64 %3, 3
%6 = add i64 %5, %4
%7 = tail call i8* @string_alloc(i64 %6)
%8 = tail call i32 @sprintf2(i8* %7, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void abuse_heap() {
  char buf[16];
  free((void *)buf);
}


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

x86 assembly (clang, -O2):
<abuse_heap>:
sub    $0x18,%rsp
mov    %rsp,%rdi
call   1030 <free@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @abuse_heap() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @free(i8* %2)
ret void
}

LLVM IR (-O2):
define void @abuse_heap() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = call i32 @free(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ net_disconnect();
void irc_disconnect() { net_disconnect(); }


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

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

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

LLVM IR (-O2):
define void @irc_disconnect() {
%1 = tail call i32 (...) @net_disconnect()
ret void
}
int length(long number) {
  int len = 0, num = number;
  while (1 == 1) {
    len++;
    if (num < 10)
      break;
    num /= 10;
  }
  return len;
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0x10(%rbp)
jge    112e <length+0x2e>
jmp    1141 <length+0x41>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x10(%rbp)
jmp    1116 <length+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
mov    $0x1,%eax
cmp    $0xa,%edi
jl     1134 <length+0x34>
mov    $0x1,%eax
mov    $0xcccccccd,%ecx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%edx
imul   %rcx,%rdx
shr    $0x23,%rdx
add    $0x1,%eax
cmp    $0x63,%edi
mov    %edx,%edi
ja     1120 <length+0x20>
ret

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

LLVM IR (-O2):
define i32 @length(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = icmp slt i32 %2, 10
br i1 %3, label %10, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ %2, %1 ]
%7 = udiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = icmp ult i32 %6, 100
br i1 %9, label %10, label %4
10: ; preds = %4, %1
%11 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *, char *);
void aw_fatal(char *reason) { fatal("%s", reason); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @aw_fatal(i8* %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int toupper(int ch) {
  if ((ch >= 'a') && (ch <= 'z'))
    return ch + 'A' - 'a';
  else
    return ch;
}


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

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

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

LLVM IR (-O2):
define i32 @toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
int ft_any(char **tab, int (*f)(char *)) {
  while (*tab != 0) {
    if (f(*(tab++)))
      return (1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<ft_any>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
je     1150 <ft_any+0x50>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x8,%rdx
mov    %rdx,-0x10(%rbp)
mov    (%rcx),%rdi
call   *%rax
cmp    $0x0,%eax
je     114b <ft_any+0x4b>
movl   $0x1,-0x4(%rbp)
jmp    1157 <ft_any+0x57>
jmp    1110 <ft_any+0x10>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_any>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
mov    (%rbx),%rdi
test   %rdi,%rdi
je     112a <ft_any+0x2a>
add    $0x8,%rbx
call   *%r14
test   %eax,%eax
je     1110 <ft_any+0x10>
mov    $0x1,%eax
jmp    112c <ft_any+0x2c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ft_any(i8** nocapture %0, i32 (i8*)* nocapture %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8** [ %0, %2 ], [ %8, %7 ]
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8*, i8** %4, i64 1
%9 = tail call i32 %1(i8* %5)
%10 = icmp eq i32 %9, 0
br i1 %10, label %3, label %11
11: ; preds = %3, %7
%12 = phi i32 [ 1, %7 ], [ 0, %3 ]
ret i32 %12
}
unsigned ceil_multiple(unsigned n, unsigned multiple) {
  return ((n + multiple - 1) / multiple) * multiple;
}


x86 assembly (clang, -O0):
<ceil_multiple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
xor    %edx,%edx
divl   -0x8(%rbp)
imul   -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_multiple>:
lea    (%rdi,%rsi,1),%ecx
add    $0xffffffff,%ecx
mov    %ecx,%eax
xor    %edx,%edx
div    %esi
sub    %edx,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ceil_multiple(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = add i32 %5, %6
%8 = sub i32 %7, 1
%9 = load i32, i32* %4
%10 = udiv i32 %8, %9
%11 = load i32, i32* %4
%12 = mul i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @ceil_multiple(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = urem i32 %4, %1
%6 = sub i32 %4, %5
ret i32 %6
}
/* Variables and functions */
int adagain(int);
int /*<<< orphan*/ primary_five(int);
int /*<<< orphan*/ primary_six(int);
int add_more(int input) {
  static int one = 1;
  int two = 2;
  two += input;
  two += one;
  two = adagain(two);
  primary_five(two);
  primary_six(two);
  return two;
}


x86 assembly (clang, -O0):
<add_more>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2ee7(%rip),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <adagain@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <primary_five@plt>
mov    -0x8(%rbp),%edi
call   1040 <primary_six@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_more>:
push   %rbx
add    $0x3,%edi
call   1050 <adagain@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1030 <primary_five@plt>
mov    %ebx,%edi
call   1040 <primary_six@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@add_more.one = internal global i32 1
define i32 @add_more(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 2, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* %3
%6 = add nsw i32 %5, %4
store i32 %6, i32* %3
%7 = load i32, i32* @add_more.one
%8 = load i32, i32* %3
%9 = add nsw i32 %8, %7
store i32 %9, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @adagain(i32 %10)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = call i32 @primary_five(i32 %12)
%14 = load i32, i32* %3
%15 = call i32 @primary_six(i32 %14)
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @add_more(i32 %0) {
%2 = add nsw i32 %0, 3
%3 = tail call i32 @adagain(i32 %2)
%4 = tail call i32 @primary_five(i32 %3)
%5 = tail call i32 @primary_six(i32 %3)
ret i32 %3
}
/* Variables and functions */
char *socket_receive_file_to_buff(int, int *);
char *client_accept_s_expr(int fd) {
  char *expr;
  int filesize;
  expr = socket_receive_file_to_buff(fd, &filesize);
  expr[filesize] = '\0';
  return expr;
}


x86 assembly (clang, -O0):
<client_accept_s_expr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1030 <socket_receive_file_to_buff@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<client_accept_s_expr>:
push   %rax
lea    0x4(%rsp),%rsi
call   1030 <socket_receive_file_to_buff@plt>
movslq 0x4(%rsp),%rcx
movb   $0x0,(%rax,%rcx,1)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @client_accept_s_expr(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = call i8* @socket_receive_file_to_buff(i32 %5, i32* %4)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
store i8 0, i8* %10
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @client_accept_s_expr(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i8* @socket_receive_file_to_buff(i32 %0, i32* %2)
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %4, i64 %6
store i8 0, i8* %7
ret i8* %4
}
int fstat(int file, struct stat *st) { return 0; }


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

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

LLVM IR (-O0):
%struct.stat = type opaque
define i32 @fstat(i32 %0, %struct.stat* %1) {
%3 = alloca i32
%4 = alloca %struct.stat*
store i32 %0, i32* %3
store %struct.stat* %1, %struct.stat** %4
ret i32 0
}

LLVM IR (-O2):
%struct.stat = type opaque
define i32 @fstat(i32 %0, %struct.stat* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int /*<<< orphan*/ android_compiler_barrier();
extern void android_atomic_release_store(int32_t value, volatile int32_t *ptr) {
  android_compiler_barrier();
  *ptr = value;
}


x86 assembly (clang, -O0):
<android_atomic_release_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <android_compiler_barrier@plt>
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<android_atomic_release_store>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <android_compiler_barrier@plt>
mov    %ebp,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define void @android_atomic_release_store(i32 %0, i32* %1) {
%3 = tail call i32 (...) @android_compiler_barrier()
store volatile i32 %0, i32* %1
ret void
}
float test_cabsf(_Complex float x) { return __builtin_cabsf(x); }


x86 assembly (clang, -O0):
<test_cabsf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movlpd %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0x4(%rbp),%xmm0
movss  %xmm1,-0x10(%rbp)
movss  %xmm0,-0xc(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <cabsf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_cabsf>:
jmp    1030 <cabsf@plt>

LLVM IR (-O0):
define float @test_cabsf(<2 x float> %0) {
%2 = alloca { float, float }
%3 = alloca { float, float }
%4 = bitcast { float, float }* %2 to <2 x float>*
store <2 x float> %0, <2 x float>* %4
%5 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 0
%6 = load float, float* %5
%7 = getelementptr inbounds { float, float }, { float, float }* %2, i32 0, i32 1
%8 = load float, float* %7
%9 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 0
%10 = getelementptr inbounds { float, float }, { float, float }* %3, i32 0, i32 1
store float %6, float* %9
store float %8, float* %10
%11 = bitcast { float, float }* %3 to <2 x float>*
%12 = load <2 x float>, <2 x float>* %11
%13 = call float @cabsf(<2 x float> %12)
ret float %13
}

LLVM IR (-O2):
define float @test_cabsf(<2 x float> %0) {
%2 = tail call float @cabsf(<2 x float> %0)
ret float %2
}
/* Variables and functions */
int search(int *, int /*<<< orphan*/, int, int);
int test_duplicates() {
  int input[] = {6, 6, 6, 6, 6, 6, 6, 1, 2, 6};
  return 7 == search(input, 0, 9, 1) && -1 == search(input, 0, 9, 5);
}


x86 assembly (clang, -O0):
<test_duplicates>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x28,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x1,%ecx
call   1030 <search@plt>
mov    %eax,%edx
xor    %eax,%eax
mov    $0x7,%ecx
cmp    %edx,%ecx
mov    %al,-0x31(%rbp)
jne    118a <test_duplicates+0x6a>
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x5,%ecx
call   1030 <search@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
sete   %al
mov    %al,-0x31(%rbp)
mov    -0x31(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_duplicates>:
push   %rbx
sub    $0x30,%rsp
mov    0xf04(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee8(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x1,%ecx
call   1030 <search@plt>
cmp    $0x7,%eax
jne    116f <test_duplicates+0x5f>
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x9,%edx
mov    $0x5,%ecx
call   1030 <search@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
sete   %bl
mov    %ebx,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.test_duplicates.input = [10 x i32] [i32 6, i32 6, i32 6, i32 6, i32 6, i32 6, i32 6, i32 1, i32 2, i32 6]
define i32 @test_duplicates() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 0, i32 9, i32 1)
%5 = icmp eq i32 7, %4
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%8 = call i32 @search(i32* %7, i32 0, i32 9, i32 5)
%9 = icmp eq i32 -1, %8
br label %10
10: ; preds = %6, %0
%11 = phi i1 [ false, %0 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@__const.test_duplicates.input = [10 x i32] [i32 6, i32 6, i32 6, i32 6, i32 6, i32 6, i32 6, i32 1, i32 2, i32 6]
define i32 @test_duplicates() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 0, i32 9, i32 1)
%5 = icmp eq i32 %4, 7
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = call i32 @search(i32* %3, i32 0, i32 9, i32 5)
%8 = icmp eq i32 %7, -1
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %0
%11 = phi i32 [ 0, %0 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int /*<<< orphan*/);
void anonname(char *buf) {
  static int anon_id = 0;
  sprintf(buf, "_anonymous_%d", anon_id++);
}


x86 assembly (clang, -O0):
<anonname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2f06(%rip),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,0x2efb(%rip)
lea    0xec8(%rip),%rsi
call   1030 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<anonname>:
mov    0x2f16(%rip),%edx
lea    0x1(%rdx),%eax
mov    %eax,0x2f0d(%rip)
lea    0xeda(%rip),%rsi
jmp    1030 <sprintf@plt>

LLVM IR (-O0):
@anonname.anon_id = internal global i32 0
@.str = [14 x i8] c"_anonymous_%d\00"
define void @anonname(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @anonname.anon_id
%5 = add nsw i32 %4, 1
store i32 %5, i32* @anonname.anon_id
%6 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}

LLVM IR (-O2):
@anonname.anon_id = internal unnamed_addr global i32 0
@.str = [14 x i8] c"_anonymous_%d\00"
define void @anonname(i8* nocapture writeonly %0) {
%2 = load i32, i32* @anonname.anon_id
%3 = add nsw i32 %2, 1
store i32 %3, i32* @anonname.anon_id
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ unauth_attr;
};
typedef TYPE_1__ PKCS7_SIGNER_INFO;
typedef int /*<<< orphan*/ ASN1_TYPE;

/* Variables and functions */
int /*<<< orphan*/ *get_attribute(int /*<<< orphan*/, int);
ASN1_TYPE *PKCS7_get_attribute(PKCS7_SIGNER_INFO *si, int nid) {
  return (get_attribute(si->unauth_attr, nid));
}


x86 assembly (clang, -O0):
<PKCS7_get_attribute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%esi
call   1030 <get_attribute@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PKCS7_get_attribute>:
mov    (%rdi),%edi
jmp    1030 <get_attribute@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32 }
define i32* @PKCS7_get_attribute(%struct.TYPE_3__* %0, i32 %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store i32 %1, i32* %4
%5 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load i32, i32* %4
%9 = call i32* @get_attribute(i32 %7, i32 %8)
ret i32* %9
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32 }
define i32* @PKCS7_get_attribute(%struct.TYPE_3__* nocapture %0, i32 %1) {
%3 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = tail call i32* @get_attribute(i32 %4, i32 %1)
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char const *);
int /*<<< orphan*/ stdout;
void usage(const char *progname) {
  fprintf(stdout,
          "Version %s\n"
          "Usage: %s [options] <firmware file> [<fw file2> ... <fw fileN>]\n"
          "\t-o <output file prefix>\t"
          " - output file prefix, default: firmware version\n"
          "\t-d\t\t\t - turn debug output on\n"
          "\t-h\t\t\t - this help\n",
          "1.2", progname);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
lea    0xed0(%rip),%rsi
lea    0xf90(%rip),%rdx
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rcx
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
lea    0xedd(%rip),%rsi
lea    0xf9d(%rip),%rdx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [199 x i8] c"Version %s\0AUsage: %s [options] <firmware file> [<fw file2> ... <fw fileN>]\0A\09-o <output file prefix>\09 - output file prefix, default: firmware version\0A\09-d\09\09\09 - turn debug output on\0A\09-h\09\09\09 - this help\0A\00"
@.str.1 = [4 x i8] c"1.2\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stdout
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([199 x i8], [199 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [199 x i8] c"Version %s\0AUsage: %s [options] <firmware file> [<fw file2> ... <fw fileN>]\0A\09-o <output file prefix>\09 - output file prefix, default: firmware version\0A\09-d\09\09\09 - turn debug output on\0A\09-h\09\09\09 - this help\0A\00"
@.str.1 = [4 x i8] c"1.2\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([199 x i8], [199 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
void B(int c) { printf("\033[%d;%d;40m", c > 37, c & 63); }


x86 assembly (clang, -O0):
<B>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x25,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%esi
mov    -0x4(%rbp),%edx
and    $0x3f,%edx
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<B>:
mov    %edi,%edx
xor    %esi,%esi
cmp    $0x26,%edi
setge  %sil
and    $0x3f,%edx
lea    0xedb(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"\1B[%d;%d;40m\00"
define void @B(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sgt i32 %3, 37
%5 = zext i1 %4 to i32
%6 = load i32, i32* %2
%7 = and i32 %6, 63
%8 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[%d;%d;40m\00"
define void @B(i32 %0) {
%2 = icmp sgt i32 %0, 37
%3 = zext i1 %2 to i32
%4 = and i32 %0, 63
%5 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret void
}
/* Type definitions */
typedef scalar_t__ int64_t;

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


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

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

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

LLVM IR (-O2):
define i64 @add_int64_t(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *command) {
  printf("Usage: %s int_0 int_1 int_2 ... int_n\n\n", command);
  printf("Sort an array composed by [int_0, int_1, int_2, ..., int_n]\n\n");
  printf("Example: %s 2 6 5\n", command);
  printf("Outputs: 2 5 6\n");
}


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

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

LLVM IR (-O0):
@.str = [40 x i8] c"Usage: %s int_0 int_1 int_2 ... int_n\0A\0A\00"
@.str.1 = [62 x i8] c"Sort an array composed by [int_0, int_1, int_2, ..., int_n]\0A\0A\00"
@.str.2 = [19 x i8] c"Example: %s 2 6 5\0A\00"
@.str.3 = [16 x i8] c"Outputs: 2 5 6\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"Usage: %s int_0 int_1 int_2 ... int_n\0A\0A\00"
@.str.2 = [19 x i8] c"Example: %s 2 6 5\0A\00"
@str = [61 x i8] c"Sort an array composed by [int_0, int_1, int_2, ..., int_n]\0A\00"
@str.4 = [15 x i8] c"Outputs: 2 5 6\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.4, i64 0, i64 0))
ret void
}
void destroy_table(char **table, int width) {
  for (int i = 0; i < width; i++)
    free(table[i]);
  free(table);
}


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

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

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

LLVM IR (-O2):
define void @destroy_table(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = bitcast i8** %0 to i8*
tail call void @free(i8* %7)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %12, %8 ]
%10 = getelementptr inbounds i8*, i8** %0, i64 %9
%11 = load i8*, i8** %10
tail call void @free(i8* %11)
%12 = add nuw nsw i64 %9, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %6, label %8
}
/* Variables and functions */
int /*<<< orphan*/ bcopy(char *, char *, size_t const);
void overlappingWriteFunction_bcopy(char *buf, const size_t count) {
  bcopy(&buf[0], &buf[3], count);
  bcopy(&buf[0], &buf[3], 3U);
  bcopy(&buf[0], &buf[3], 4U);
}


x86 assembly (clang, -O0):
<overlappingWriteFunction_bcopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x3,%rsi
mov    -0x10(%rbp),%rdx
call   1030 <bcopy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x3,%rsi
mov    $0x3,%edx
call   1030 <bcopy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x3,%rsi
mov    $0x4,%edx
call   1030 <bcopy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<overlappingWriteFunction_bcopy>:
push   %rbx
mov    %rsi,%rdx
mov    %rdi,%rbx
add    $0x3,%rdi
mov    %rbx,%rsi
call   1030 <memmove@plt>
movzwl (%rbx),%eax
mov    %ax,0x3(%rbx)
mov    0x2(%rbx),%al
mov    %al,0x5(%rbx)
mov    (%rbx),%eax
mov    %eax,0x3(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @overlappingWriteFunction_bcopy(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 3
%9 = load i64, i64* %4
%10 = call i32 @bcopy(i8* %6, i8* %8, i64 %9)
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i64 0
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 3
%15 = call i32 @bcopy(i8* %12, i8* %14, i64 3)
%16 = load i8*, i8** %3
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 3
%20 = call i32 @bcopy(i8* %17, i8* %19, i64 4)
ret void
}

LLVM IR (-O2):
define void @overlappingWriteFunction_bcopy(i8* nocapture %0, i64 %1) {
%3 = getelementptr inbounds i8, i8* %0, i64 3
tail call void @llvm.memmove.p0i8.p0i8.i64(i8* align 1 %3, i8* align 1 %0, i64 %1, i1 false)
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %3, i8* align 1 dereferenceable(3) %0, i64 3, i1 false)
%4 = bitcast i8* %0 to i32*
%5 = bitcast i8* %3 to i32*
%6 = load i32, i32* %4
store i32 %6, i32* %5
ret void
}
/* Variables and functions */
float __nv_acosf(float);
float acosf(float __a) { return __nv_acosf(__a); }


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

x86 assembly (clang, -O2):
<acosf>:
jmp    1030 <__nv_acosf@plt>

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

LLVM IR (-O2):
define float @acosf(float %0) {
%2 = tail call float @__nv_acosf(float %0)
ret float %2
}
int_to_ieee(r, a, iflg) short r, *a;
int iflg;
{
  *a = r;
  if (iflg == 1)
    *a = 0x8000;
}


x86 assembly (clang, -O0):
<int_to_ieee>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x6(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
cmpl   $0x1,-0x14(%rbp)
jne    1130 <int_to_ieee+0x30>
mov    -0x10(%rbp),%rax
movw   $0x8000,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_ieee>:
cmp    $0x1,%edx
mov    $0x8000,%eax
cmovne %edi,%eax
mov    %ax,(%rsi)
ret

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

LLVM IR (-O2):
define i32 @int_to_ieee(i32 %0, i16* nocapture writeonly %1, i32 %2) {
%4 = trunc i32 %0 to i16
%5 = icmp eq i32 %2, 1
%6 = select i1 %5, i16 -32768, i16 %4
store i16 %6, i16* %1
ret i32 undef
}
int test_imm_ADuint16_reg(unsigned short val) {
  return ((val) & (0xAD << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_ADuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xad,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_ADuint16_reg>:
test   $0xad,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_ADuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, 173
%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_ADuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 173
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
struct _tuple0 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_IOEffect_my_qvar_cmp(struct _tuple0 *, struct _tuple0 *);
int Cyc_IOEffect_not_my_qvar_cmp(struct _tuple0 *q1, struct _tuple0 *q2) {
  return !({ Cyc_IOEffect_my_qvar_cmp(q1, q2); });
}


x86 assembly (clang, -O0):
<Cyc_IOEffect_not_my_qvar_cmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <Cyc_IOEffect_my_qvar_cmp@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_IOEffect_not_my_qvar_cmp>:
push   %rax
call   1030 <Cyc_IOEffect_my_qvar_cmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct._tuple0 = type { i32 }
define i32 @Cyc_IOEffect_not_my_qvar_cmp(%struct._tuple0* %0, %struct._tuple0* %1) {
%3 = alloca %struct._tuple0*
%4 = alloca %struct._tuple0*
%5 = alloca i32
store %struct._tuple0* %0, %struct._tuple0** %3
store %struct._tuple0* %1, %struct._tuple0** %4
%6 = load %struct._tuple0*, %struct._tuple0** %3
%7 = load %struct._tuple0*, %struct._tuple0** %4
%8 = call i32 @Cyc_IOEffect_my_qvar_cmp(%struct._tuple0* %6, %struct._tuple0* %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
%struct._tuple0 = type { i32 }
define i32 @Cyc_IOEffect_not_my_qvar_cmp(%struct._tuple0* %0, %struct._tuple0* %1) {
%3 = tail call i32 @Cyc_IOEffect_my_qvar_cmp(%struct._tuple0* %0, %struct._tuple0* %1)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int fh_tcp_writeex(int, void const *, int, int /*<<< orphan*/);
int fh_tcp_write(int s, const void *buf, int nbytes) {
  return fh_tcp_writeex(s, buf, nbytes, 0);
}


x86 assembly (clang, -O0):
<fh_tcp_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
xor    %ecx,%ecx
call   1030 <fh_tcp_writeex@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fh_tcp_write>:
xor    %ecx,%ecx
jmp    1030 <fh_tcp_writeex@plt>

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

LLVM IR (-O2):
define i32 @fh_tcp_write(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @fh_tcp_writeex(i32 %0, i8* %1, i32 %2, i32 0)
ret i32 %4
}
void call_function_that_accepts_fun_t() {}


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

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

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

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