xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int getc(int /*<<< orphan*/ *);
int nextc(void *closure) {
  FILE *fp = closure;
  int c = getc(fp);
  if (c == EOF)
    return '\0';
  return c;
}


x86 assembly (clang, -O0):
<nextc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <getc@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    0x2eae(%rip),%rcx
cmp    (%rcx),%eax
jne    114e <nextc+0x3e>
movl   $0x0,-0x4(%rbp)
jmp    1154 <nextc+0x44>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextc>:
push   %rax
call   1030 <getc@plt>
mov    0x2ecb(%rip),%rcx
xor    %edx,%edx
cmp    (%rcx),%eax
cmove  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EOF = global i32 0
define i32 @nextc(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i32
store i8* %0, i8** %3
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %4
%8 = load i32*, i32** %4
%9 = call i32 @getc(i32* %8)
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* @EOF
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 0, i32* %2
br label %16
14: ; preds = %1
%15 = load i32, i32* %5
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %13
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@EOF = global i32 0
define i32 @nextc(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @getc(i32* %2)
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
%6 = select i1 %5, i32 0, i32 %3
ret i32 %6
}
/* Variables and functions */
scalar_t__ eval_boolean(char *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void cmd_quit_if(const char *assign_to, char *arg) {
  (void)assign_to;
  if (eval_boolean(arg))
    exit(0);
}


x86 assembly (clang, -O0):
<cmd_quit_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <eval_boolean@plt>
cmp    $0x0,%rax
je     114a <cmd_quit_if+0x2a>
xor    %edi,%edi
call   1030 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmd_quit_if>:
push   %rax
mov    %rsi,%rdi
call   1040 <eval_boolean@plt>
test   %rax,%rax
jne    1130 <cmd_quit_if+0x10>
pop    %rax
ret
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @cmd_quit_if(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 i64 @eval_boolean(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @exit(i32 0)
unreachable
11: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @cmd_quit_if(i8* nocapture readnone %0, i8* %1) {
%3 = tail call i64 @eval_boolean(i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @exit(i32 0)
unreachable
7: ; preds = %2
ret void
}
void xlp_init_node_msi_irqs(int node, int link) {}


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

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

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

LLVM IR (-O2):
define void @xlp_init_node_msi_irqs(i32 %0, i32 %1) {
ret void
}
int isLeapYear(int year) {
  if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isLeapYear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    112f <isLeapYear+0x2f>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1143 <isLeapYear+0x43>
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <isLeapYear+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1156 <isLeapYear+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isLeapYear>:
test   $0x3,%dil
sete   %al
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
cmp    $0x28f5c29,%edx
setae  %dl
and    %al,%dl
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
setb   %al
or     %dl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @isLeapYear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
%4 = srem i32 %0, 100
%5 = icmp ne i32 %4, 0
%6 = and i1 %3, %5
%7 = srem i32 %0, 400
%8 = icmp eq i32 %7, 0
%9 = or i1 %8, %6
%10 = zext i1 %9 to i32
ret i32 %10
}
/* Variables and functions */
int atol(char const *);
char *get_str(char *, int);
int get_long(char *line, int column_number) {
  if (column_number >= 0) {
    const char *s = get_str(line, column_number);
    return s ? atol(s) : 0;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<get_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jl     117a <get_long+0x5a>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <get_str@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1165 <get_long+0x45>
mov    -0x20(%rbp),%rdi
call   1040 <atol@plt>
mov    %eax,-0x24(%rbp)
jmp    116f <get_long+0x4f>
xor    %eax,%eax
mov    %eax,-0x24(%rbp)
jmp    116f <get_long+0x4f>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1181 <get_long+0x61>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_long>:
test   %esi,%esi
js     113c <get_long+0x1c>
push   %rax
call   1030 <get_str@plt>
test   %rax,%rax
lea    0x8(%rsp),%rsp
je     113c <get_long+0x1c>
mov    %rax,%rdi
jmp    1040 <atol@plt>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @get_long(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, -1
br i1 %3, label %4, label %9
4: ; preds = %2
%5 = tail call i8* @get_str(i8* %0, i32 %1)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = tail call i32 @atol(i8* %5)
br label %9
9: ; preds = %2, %7, %4
%10 = phi i32 [ %8, %7 ], [ 0, %4 ], [ 0, %2 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
bool tread_obj_start(void *s) {
  fprintf(stderr, "obj_start\n");
  return true;
}


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

x86 assembly (clang, -O2):
<tread_obj_start>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [11 x i8] c"obj_start\0A\00"
define i32 @tread_obj_start(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [11 x i8] c"obj_start\0A\00"
define i32 @tread_obj_start(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
/* Variables and functions */
unsigned int vcmpgeu4(unsigned int, unsigned int);
unsigned int vabsdiffu4(unsigned int a, unsigned int b) {
  unsigned int r, s;
  s = vcmpgeu4(a, b);
  r = a ^ b;
  s = (r & s) ^ b;
  r = s ^ r;
  r = s - r;
  return r;
}


x86 assembly (clang, -O0):
<vabsdiffu4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <vcmpgeu4@plt>
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vabsdiffu4>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1030 <vcmpgeu4@plt>
mov    %ebx,%ecx
xor    %ebp,%ecx
and    %eax,%ecx
xor    %ecx,%ebx
xor    %ebp,%ecx
sub    %ecx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @vabsdiffu4(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @vcmpgeu4(i32 %7, i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = xor i32 %10, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = and i32 %13, %14
%16 = load i32, i32* %4
%17 = xor i32 %15, %16
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = load i32, i32* %5
%20 = xor i32 %18, %19
store i32 %20, i32* %5
%21 = load i32, i32* %6
%22 = load i32, i32* %5
%23 = sub i32 %21, %22
store i32 %23, i32* %5
%24 = load i32, i32* %5
ret i32 %24
}

LLVM IR (-O2):
define i32 @vabsdiffu4(i32 %0, i32 %1) {
%3 = tail call i32 @vcmpgeu4(i32 %0, i32 %1)
%4 = xor i32 %1, %0
%5 = and i32 %3, %4
%6 = xor i32 %5, %1
%7 = xor i32 %5, %0
%8 = sub i32 %6, %7
ret i32 %8
}
unsigned int get_card_vers(unsigned int version) { return (version & 0x3ff); }


x86 assembly (clang, -O0):
<get_card_vers>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x3ff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_card_vers>:
mov    %edi,%eax
and    $0x3ff,%eax
ret

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

LLVM IR (-O2):
define i32 @get_card_vers(i32 %0) {
%2 = and i32 %0, 1023
ret i32 %2
}
__attribute__((always_)) unsigned int jiffies_to_usecs(const unsigned long j) {
  return ((1000000L) / 250) * j;
}


x86 assembly (clang, -O0):
<jiffies_to_usecs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
imul   $0xfa0,-0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<jiffies_to_usecs>:
imul   $0xfa0,%edi,%eax
ret

LLVM IR (-O0):
define i32 @jiffies_to_usecs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = mul i64 4000, %3
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @jiffies_to_usecs(i64 %0) {
%2 = trunc i64 %0 to i32
%3 = mul i32 %2, 4000
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ write(int /*<<< orphan*/, char *, int);
void do_onebyte() {
  char c = 'X';
  write(STDOUT_FILENO, &c, 1);
}


x86 assembly (clang, -O0):
<do_onebyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x58,-0x1(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_onebyte>:
push   %rax
movb   $0x58,0x7(%rsp)
mov    0x2ed3(%rip),%rax
mov    (%rax),%edi
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
pop    %rax
ret

LLVM IR (-O0):
@STDOUT_FILENO = global i32 0
define void @do_onebyte() {
%1 = alloca i8
store i8 88, i8* %1
%2 = load i32, i32* @STDOUT_FILENO
%3 = call i32 @write(i32 %2, i8* %1, i32 1)
ret void
}

LLVM IR (-O2):
@STDOUT_FILENO = global i32 0
define void @do_onebyte() {
%1 = alloca i8
store i8 88, i8* %1
%2 = load i32, i32* @STDOUT_FILENO
%3 = call i32 @write(i32 %2, i8* %1, i32 1)
ret void
}
/* Type definitions */
struct tm {
  int dummy;
};
struct timespec {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(struct timespec *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
char *format_time(struct timespec cal_time) {
  struct tm *time_struct;
  static char string[30];
  time_struct = localtime(&cal_time);
  strftime(string, sizeof string, "%h %e %H:%M", time_struct);
  return (string);
}


x86 assembly (clang, -O0):
<format_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0x2efd(%rip),%rdi
mov    $0x1e,%esi
lea    0xeb1(%rip),%rdx
call   1040 <strftime@plt>
lea    0x2ee5(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_time>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <localtime@plt>
lea    0x2f06(%rip),%rbx
lea    0xebf(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1e,%esi
mov    %rax,%rcx
call   1040 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
%struct.tm = type { i32 }
@format_time.string = internal global [30 x i8] zeroinitializer
@.str = [12 x i8] c"%h %e %H:%M\00"
define i8* @format_time(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.tm*
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i32 0, i32 0
store i32 %0, i32* %4
%5 = call %struct.tm* @localtime(%struct.timespec* %2)
store %struct.tm* %5, %struct.tm** %3
%6 = load %struct.tm*, %struct.tm** %3
%7 = call i32 @strftime(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @format_time.string, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.tm* %6)
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @format_time.string, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
%struct.tm = type { i32 }
@format_time.string = internal global [30 x i8] zeroinitializer
@.str = [12 x i8] c"%h %e %H:%M\00"
define i8* @format_time(i32 %0) {
%2 = alloca %struct.timespec
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %0, i32* %3
%4 = call %struct.tm* @localtime(%struct.timespec* %2)
%5 = call i32 @strftime(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @format_time.string, i64 0, i64 0), i32 30, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret i8* getelementptr inbounds ([30 x i8], [30 x i8]* @format_time.string, i64 0, i64 0)
}
int digitcount(int n) {
  int c = 1;
  n /= 10;
  while (n) {
    c++;
    n /= 10;
  }
  return c;
}


x86 assembly (clang, -O0):
<digitcount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1142 <digitcount+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    111c <digitcount+0x1c>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitcount>:
lea    0x9(%rdi),%ecx
mov    $0x1,%eax
cmp    $0x13,%ecx
jb     1145 <digitcount+0x45>
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
lea    (%rcx,%rdx,1),%edi
add    $0x1,%eax
add    %edx,%ecx
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1120 <digitcount+0x20>
ret

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

LLVM IR (-O2):
define i32 @digitcount(i32 %0) {
%2 = add i32 %0, 9
%3 = icmp ult i32 %2, 19
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 1, %1 ]
%6 = phi i32 [ %7, %4 ], [ %0, %1 ]
%7 = sdiv i32 %6, 10
%8 = add nuw nsw i32 %5, 1
%9 = add nsw i32 %7, 9
%10 = icmp ult i32 %9, 19
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 1, %1 ], [ %8, %4 ]
ret i32 %12
}
int unused(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @unused() {
ret i32 1
}

LLVM IR (-O2):
define i32 @unused() {
ret i32 1
}
/* Type definitions */
struct __test_metadata {
  int dummy;
};
struct __fixture_variant_metadata {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pac_instructions_not_nop(struct __test_metadata *);
void wrapper_pac_instructions_not_nop(
    struct __test_metadata *_metadata,
    struct __fixture_variant_metadata *variant) {
  pac_instructions_not_nop(_metadata);
}


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

x86 assembly (clang, -O2):
<wrapper_pac_instructions_not_nop>:
jmp    1030 <pac_instructions_not_nop@plt>

LLVM IR (-O0):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_pac_instructions_not_nop(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* %1) {
%3 = alloca %struct.__test_metadata*
%4 = alloca %struct.__fixture_variant_metadata*
store %struct.__test_metadata* %0, %struct.__test_metadata** %3
store %struct.__fixture_variant_metadata* %1, %struct.__fixture_variant_metadata** %4
%5 = load %struct.__test_metadata*, %struct.__test_metadata** %3
%6 = call i32 @pac_instructions_not_nop(%struct.__test_metadata* %5)
ret void
}

LLVM IR (-O2):
%struct.__test_metadata = type { i32 }
%struct.__fixture_variant_metadata = type { i32 }
define void @wrapper_pac_instructions_not_nop(%struct.__test_metadata* %0, %struct.__fixture_variant_metadata* nocapture readnone %1) {
%3 = tail call i32 @pac_instructions_not_nop(%struct.__test_metadata* %0)
ret void
}
void to_whitespace(char **data) {
  while (**data && **data != ' ')
    ++*data;
}


x86 assembly (clang, -O0):
<to_whitespace>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1133 <to_whitespace+0x33>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1143 <to_whitespace+0x43>
jmp    1156 <to_whitespace+0x56>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    1108 <to_whitespace+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_whitespace>:
mov    (%rdi),%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%rax
testb  $0xdf,-0x1(%rax)
je     111f <to_whitespace+0x1f>
mov    %rax,(%rdi)
jmp    1110 <to_whitespace+0x10>
ret

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

LLVM IR (-O2):
define void @to_whitespace(i8** nocapture %0) {
%2 = load i8*, i8** %0
br label %3
3: ; preds = %6, %1
%4 = phi i8* [ %7, %6 ], [ %2, %1 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %8
i8 32, label %8
]
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %0
br label %3
8: ; preds = %3, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sub1();
int /*<<< orphan*/ sub2();
int main() {
  sub1();
  sub2();
  exit(0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <sub1@plt>
xor    %eax,%eax
call   1030 <sub2@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @sub1()
%2 = tail call i32 (...) @sub2()
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int key_t;

/* Variables and functions */
int ftok(char *, char);
int /*<<< orphan*/ perror(char *);
key_t generateKey(void) {
  key_t key;
  key = ftok("/etc", 'b');
  if (key == -1) {
    perror("ftok");
  }
  return key;
}


x86 assembly (clang, -O0):
<generateKey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x62,%esi
call   1040 <ftok@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1152 <generateKey+0x32>
lea    0xeb8(%rip),%rdi
call   1030 <perror@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateKey>:
push   %rbx
lea    0xed8(%rip),%rdi
mov    $0x62,%esi
call   1040 <ftok@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     113d <generateKey+0x1d>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xec1(%rip),%rdi
call   1030 <perror@plt>
jmp    1139 <generateKey+0x19>

LLVM IR (-O0):
@.str = [5 x i8] c"/etc\00"
@.str.1 = [5 x i8] c"ftok\00"
define i32 @generateKey() {
%1 = alloca i32
%2 = call i32 @ftok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 98)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"/etc\00"
@.str.1 = [5 x i8] c"ftok\00"
define i32 @generateKey() {
%1 = tail call i32 @ftok(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext 98)
%2 = icmp eq i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %3, %0
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *malloc_or_die(size_t size) {
  void *result = malloc(size);
  if (!result) {
    fprintf(stderr, "Allocation failure.");
    exit(1);
  };
  return result;
}


x86 assembly (clang, -O0):
<malloc_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <malloc_or_die+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_or_die>:
push   %rax
call   1040 <malloc@plt>
test   %rax,%rax
je     113d <malloc_or_die+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"Allocation failure.\00"
define i8* @malloc_or_die(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %12, label %8
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"Allocation failure.\00"
define noalias i8* @malloc_or_die(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int hd_line(FILE *f) {
  static int count = 0;
  if (!count++)
    printf("No header has been defined for the lineitem table\n");
  return (0);
}


x86 assembly (clang, -O0):
<hd_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2f0a(%rip),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,0x2eff(%rip)
cmp    $0x0,%eax
jne    1142 <hd_line+0x32>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hd_line>:
push   %rax
mov    0x2f15(%rip),%eax
lea    0x1(%rax),%ecx
mov    %ecx,0x2f0c(%rip)
test   %eax,%eax
jne    1130 <hd_line+0x20>
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@hd_line.count = internal global i32 0
@.str = [51 x i8] c"No header has been defined for the lineitem table\0A\00"
define i32 @hd_line(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32, i32* @hd_line.count
%4 = add nsw i32 %3, 1
store i32 %4, i32* @hd_line.count
%5 = icmp ne i32 %3, 0
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i32 0
}

LLVM IR (-O2):
@hd_line.count = internal unnamed_addr global i32 0
@str = [50 x i8] c"No header has been defined for the lineitem table\00"
define i32 @hd_line(i32* nocapture readnone %0) {
%2 = load i32, i32* @hd_line.count
%3 = add nsw i32 %2, 1
store i32 %3, i32* @hd_line.count
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %5, %1
ret i32 0
}
/* Type definitions */
struct sembuf {
  int member_1;
  int /*<<< orphan*/ member_2;
  int /*<<< orphan*/ member_0;
};

/* Variables and functions */
int semop(int, struct sembuf *, int);
int p(int semid) {
  struct sembuf sops = {0, -1, 0};
  return (semop(semid, &sops, 1));
}


x86 assembly (clang, -O0):
<p>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xede(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xedc(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x10(%rbp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    $0x1,%edx
call   1030 <semop@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32, i32, i32 }
@__const.p.sops = %struct.sembuf { i32 0, i32 -1, i32 0 }
define i32 @p(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.sembuf
store i32 %0, i32* %2
%4 = bitcast %struct.sembuf* %3 to i8*
%5 = load i32, i32* %2
%6 = call i32 @semop(i32 %5, %struct.sembuf* %3, i32 1)
ret i32 %6
}

LLVM IR (-O2):
%struct.sembuf = type { i32, i32, i32 }
@__const.p.sops = %struct.sembuf { i32 0, i32 -1, i32 0 }
define i32 @p(i32 %0) {
%2 = alloca %struct.sembuf
%3 = bitcast %struct.sembuf* %2 to i8*
%4 = call i32 @semop(i32 %0, %struct.sembuf* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Trivial test is working.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Trivial test is working.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [25 x i8] c"Trivial test is working.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ do_print();
int main() {
  do_print();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @do_print()
ret i32 0
}
void gpio_sensor_select(int sensor) {}


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

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

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

LLVM IR (-O2):
define void @gpio_sensor_select(i32 %0) {
ret void
}
struct rocker_tlv *rocker_tlv_start(char *buf, int buf_pos) {
  return (struct rocker_tlv *)(buf + buf_pos);
}


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

x86 assembly (clang, -O2):
<rocker_tlv_start>:
movslq %esi,%rax
add    %rdi,%rax
ret

LLVM IR (-O0):
%struct.rocker_tlv = type opaque
define %struct.rocker_tlv* @rocker_tlv_start(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = bitcast i8* %8 to %struct.rocker_tlv*
ret %struct.rocker_tlv* %9
}

LLVM IR (-O2):
%struct.rocker_tlv = type opaque
define %struct.rocker_tlv* @rocker_tlv_start(i8* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = bitcast i8* %4 to %struct.rocker_tlv*
ret %struct.rocker_tlv* %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ ret;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ le32toh(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
uint32_t metadata_get_flags(const uint8_t *header) {
  uint32_t ret;
  assert(sizeof(ret) == (sizeof(uint32_t)));
  memcpy(&ret, &header[(((sizeof(uint32_t))) + (sizeof(uint64_t)))],
         (sizeof(uint32_t)));
  return le32toh(ret);
}


x86 assembly (clang, -O0):
<metadata_get_flags>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rsi
add    $0x20,%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1030 <le32toh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<metadata_get_flags>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    $0x1,%edi
call   1040 <assert@plt>
add    $0x20,%rbx
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
mov    0xc(%rsp),%edi
call   1030 <le32toh@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @metadata_get_flags(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = call i32 @assert(i32 1)
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 8
%7 = call i32 @memcpy(i32* %3, i32* %6, i32 4)
%8 = load i32, i32* %3
%9 = call i32 @le32toh(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @metadata_get_flags(i32* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @assert(i32 1)
%5 = getelementptr inbounds i32, i32* %0, i64 8
%6 = call i32 @memcpy(i32* %2, i32* %5, i32 4)
%7 = load i32, i32* %2
%8 = call i32 @le32toh(i32 %7)
ret i32 %8
}
int test_imm_47uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x47 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_47uint64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
shr    $0x20,%rdx
and    $0x47,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_47uint64_highword_reg>:
movabs $0x4700000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_47uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 71
%6 = icmp ne i64 %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_47uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 304942678016
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void gtk_window_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_get_type() {
ret void
}
/* Variables and functions */
char *getenv(char *);
char *cgiRequestContentLength() { return getenv("CONTENT_LENGTH"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"CONTENT_LENGTH\00"
define i8* @cgiRequestContentLength() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [15 x i8] c"CONTENT_LENGTH\00"
define i8* @cgiRequestContentLength() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int main() {
  int i;
  for (i = 0; i <= 255; i++) {
    printf("\n%d -> %c", i, i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"\0A%d -> %c\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void AONRTCDelayConfig(uint32_t ui32Delay) {
  uint32_t ui32Cfg;
  ;
  ui32Cfg = (*((volatile unsigned long *)(0x40092000 + 0x00000000)));
  ui32Cfg &= ~(0x00000F00);
  ui32Cfg |= (ui32Delay << 8);
  (*((volatile unsigned long *)(0x40092000 + 0x00000000))) = ui32Cfg;
}


x86 assembly (clang, -O0):
<AONRTCDelayConfig>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x40092000,%eax
mov    (%rax),%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffff0ff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
movslq -0x8(%rbp),%rcx
mov    $0x40092000,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<AONRTCDelayConfig>:
mov    0x40092000,%rax
40
and    $0xfffff0ff,%eax
shl    $0x8,%edi
or     %eax,%edi
movslq %edi,%rax
mov    %rax,0x40092000
40
ret

LLVM IR (-O0):
define void @AONRTCDelayConfig(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load volatile i64, i64* inttoptr (i64 1074339840 to i64*)
%5 = trunc i64 %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = and i32 %6, -3841
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = shl i32 %8, 8
%10 = load i32, i32* %3
%11 = or i32 %10, %9
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
store volatile i64 %13, i64* inttoptr (i64 1074339840 to i64*)
ret void
}

LLVM IR (-O2):
define void @AONRTCDelayConfig(i32 %0) {
%2 = load volatile i64, i64* inttoptr (i64 1074339840 to i64*)
%3 = trunc i64 %2 to i32
%4 = and i32 %3, -3841
%5 = shl i32 %0, 8
%6 = or i32 %4, %5
%7 = sext i32 %6 to i64
store volatile i64 %7, i64* inttoptr (i64 1074339840 to i64*)
ret void
}
void getlastcol(float *A, float *v) {
  int i;
  for (i = 0; i < 32; i++)
    v[i] = A[i * 32 + 32 - 1];
}


x86 assembly (clang, -O0):
<getlastcol>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    1150 <getlastcol+0x50>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x5,%ecx
add    $0x20,%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <getlastcol+0x13>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getlastcol>:
add    $0x1fc,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movss  -0x180(%rdi),%xmm0
ff
movss  %xmm0,(%rsi,%rax,4)
movss  -0x100(%rdi),%xmm0
ff
movss  %xmm0,0x4(%rsi,%rax,4)
movss  -0x80(%rdi),%xmm0
movss  %xmm0,0x8(%rsi,%rax,4)
movss  (%rdi),%xmm0
movss  %xmm0,0xc(%rsi,%rax,4)
add    $0x4,%rax
add    $0x200,%rdi
cmp    $0x20,%rax
jne    1110 <getlastcol+0x10>
ret

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

LLVM IR (-O2):
define void @getlastcol(float* nocapture %0, float* nocapture writeonly %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %28, %3 ]
%5 = shl nuw nsw i64 %4, 5
%6 = or i64 %5, 31
%7 = getelementptr inbounds float, float* %0, i64 %6
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %1, i64 %4
store float %8, float* %9
%10 = or i64 %4, 1
%11 = shl nuw nsw i64 %10, 5
%12 = or i64 %11, 31
%13 = getelementptr inbounds float, float* %0, i64 %12
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %1, i64 %10
store float %14, float* %15
%16 = or i64 %4, 2
%17 = shl nuw nsw i64 %16, 5
%18 = or i64 %17, 31
%19 = getelementptr inbounds float, float* %0, i64 %18
%20 = load float, float* %19
%21 = getelementptr inbounds float, float* %1, i64 %16
store float %20, float* %21
%22 = or i64 %4, 3
%23 = shl nuw nsw i64 %22, 5
%24 = or i64 %23, 31
%25 = getelementptr inbounds float, float* %0, i64 %24
%26 = load float, float* %25
%27 = getelementptr inbounds float, float* %1, i64 %22
store float %26, float* %27
%28 = add nuw nsw i64 %4, 4
%29 = icmp eq i64 %28, 32
br i1 %29, label %30, label %3
30: ; preds = %3
ret void
}
void delay(unsigned int z) {
  unsigned int x = 0, y = 0;
  for (; x < z; x++) {
    for (; y < 74; y++)
      ;
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1156 <delay+0x56>
jmp    1126 <delay+0x26>
cmpl   $0x4a,-0xc(%rbp)
jae    1143 <delay+0x43>
jmp    1135 <delay+0x35>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1126 <delay+0x26>
jmp    1148 <delay+0x48>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <delay+0x15>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @delay(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void cmsMem_free(void *ptr) { free(ptr); }


x86 assembly (clang, -O0):
<cmsMem_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):
<cmsMem_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @cmsMem_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 @cmsMem_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ O_CREAT;
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void my_create() {
  int fd = open("test.txt", O_CREAT);
  if (fd == -1) {
    perror("create");
  }
}


x86 assembly (clang, -O0):
<my_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
lea    0xec8(%rip),%rdi
call   1030 <open@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1156 <my_create+0x36>
lea    0xeb8(%rip),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_create>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%esi
lea    0xecf(%rip),%rdi
call   1030 <open@plt>
cmp    $0xffffffff,%eax
je     113d <my_create+0x1d>
pop    %rax
ret
lea    0xec5(%rip),%rdi
pop    %rax
jmp    1040 <perror@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"test.txt\00"
@O_CREAT = global i32 0
@.str.1 = [7 x i8] c"create\00"
define void @my_create() {
%1 = alloca i32
%2 = load i32, i32* @O_CREAT
%3 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"test.txt\00"
@O_CREAT = global i32 0
@.str.1 = [7 x i8] c"create\00"
define void @my_create() {
%1 = load i32, i32* @O_CREAT
%2 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
uint64_t mp_mul_256(uint64_t c[8], uint64_t a[4], uint64_t b[4]) {
  c[0] = a[1] + b[2];
  return 0;
}


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

x86 assembly (clang, -O2):
<mp_mul_256>:
mov    0x10(%rdx),%rax
add    0x8(%rsi),%rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i64 @mp_mul_256(i64* %0, i64* %1, i64* %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64*
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%7 = load i64*, i64** %5
%8 = getelementptr inbounds i64, i64* %7, i64 1
%9 = load i64, i64* %8
%10 = load i64*, i64** %6
%11 = getelementptr inbounds i64, i64* %10, i64 2
%12 = load i64, i64* %11
%13 = add nsw i64 %9, %12
%14 = load i64*, i64** %4
%15 = getelementptr inbounds i64, i64* %14, i64 0
store i64 %13, i64* %15
ret i64 0
}

LLVM IR (-O2):
define i64 @mp_mul_256(i64* nocapture writeonly %0, i64* nocapture %1, i64* nocapture %2) {
%4 = getelementptr inbounds i64, i64* %1, i64 1
%5 = load i64, i64* %4
%6 = getelementptr inbounds i64, i64* %2, i64 2
%7 = load i64, i64* %6
%8 = add nsw i64 %7, %5
store i64 %8, i64* %0
ret i64 0
}