xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_PostfixSyntaxCannotFinishWithExpression(long p_position) {
  _Error(p_position,
         "Postfix operator syntax cannot finish with an expression");
}


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

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

LLVM IR (-O0):
@.str = [57 x i8] c"Postfix operator syntax cannot finish with an expression\00"
define void @Error_PostfixSyntaxCannotFinishWithExpression(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [57 x i8] c"Postfix operator syntax cannot finish with an expression\00"
define void @Error_PostfixSyntaxCannotFinishWithExpression(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ net_send(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char *, char *, char *);
void irc_raw(char *prefix, char *type, char *message) {
  char msg[(512 - 3)];
  snprintf(msg, (512 - 3), ":%s %s %s", prefix, type, message);
  net_send(msg);
}


x86 assembly (clang, -O0):
<irc_raw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    $0x1fd,%esi
lea    0xeaa(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x220(%rbp),%rdi
call   1040 <net_send@plt>
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<irc_raw>:
push   %rbx
sub    $0x200,%rsp
mov    %rdx,%r9
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xec8(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x1fd,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <net_send@plt>
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c":%s %s %s\00"
define void @irc_raw(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [509 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [509 x i8], [509 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @snprintf(i8* %8, i32 509, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
%13 = getelementptr inbounds [509 x i8], [509 x i8]* %7, i64 0, i64 0
%14 = call i32 @net_send(i8* %13)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c":%s %s %s\00"
define void @irc_raw(i8* %0, i8* %1, i8* %2) {
%4 = alloca [509 x i8]
%5 = getelementptr inbounds [509 x i8], [509 x i8]* %4, i64 0, i64 0
%6 = call i32 @snprintf(i8* %5, i32 509, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1, i8* %2)
%7 = call i32 @net_send(i8* %5)
ret void
}
void check_io(out, arg) int out;
struct expr *arg;
{
  if (out)
    outputable(arg);
  else
    inputable(arg);
}


x86 assembly (clang, -O0):
<check_io>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <check_io+0x29>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <outputable@plt>
jmp    1154 <check_io+0x34>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <inputable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_io>:
test   %edi,%edi
je     112e <check_io+0xe>
mov    %rsi,%rdi
xor    %eax,%eax
jmp    1040 <outputable@plt>
mov    %rsi,%rdi
xor    %eax,%eax
jmp    1030 <inputable@plt>

LLVM IR (-O0):
%struct.expr = type opaque
define void @check_io(i32 %0, %struct.expr* %1) {
%3 = alloca i32
%4 = alloca %struct.expr*
store i32 %0, i32* %3
store %struct.expr* %1, %struct.expr** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load %struct.expr*, %struct.expr** %4
%9 = call i32 (%struct.expr*, ...) bitcast (i32 (...)* @outputable to i32 (%struct.expr*, ...)*)(%struct.expr* %8)
br label %13
10: ; preds = %2
%11 = load %struct.expr*, %struct.expr** %4
%12 = call i32 (%struct.expr*, ...) bitcast (i32 (...)* @inputable to i32 (%struct.expr*, ...)*)(%struct.expr* %11)
br label %13
13: ; preds = %10, %7
ret void
}

LLVM IR (-O2):
%struct.expr = type opaque
define void @check_io(i32 %0, %struct.expr* %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 (%struct.expr*, ...) bitcast (i32 (...)* @outputable to i32 (%struct.expr*, ...)*)(%struct.expr* %1)
br label %8
6: ; preds = %2
%7 = tail call i32 (%struct.expr*, ...) bitcast (i32 (...)* @inputable to i32 (%struct.expr*, ...)*)(%struct.expr* %1)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sgen(char *, char *, char *);
void cgstorgw(char *s) { sgen("%s\t%%eax,%s", "movl", s); }


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

x86 assembly (clang, -O2):
<cgstorgw>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xeeb(%rip),%rsi
jmp    1030 <sgen@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"%s\09%%eax,%s\00"
@.str.1 = [5 x i8] c"movl\00"
define void @cgstorgw(i8* %0) {
%2 = tail call i32 @sgen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(int);
int /*<<< orphan*/ printf(char *, int);
void vla(int n) {
  typedef int ar[n];
  printf("new vla, sizeof = %d\n", sizeof(ar));
  f(n);
}


x86 assembly (clang, -O0):
<vla>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%rax
mov    %eax,%esi
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vla>:
push   %rbx
mov    %edi,%ebx
lea    0x0(,%rbx,4),%esi
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <f@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"new vla, sizeof = %d\0A\00"
define void @vla(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = mul nuw i64 4, %4
%6 = trunc i64 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %2
%9 = call i32 @f(i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"new vla, sizeof = %d\0A\00"
define void @vla(i32 %0) {
%2 = shl i32 %0, 2
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @f(i32 %0)
ret void
}
int sum(int num_seq[5]) {
  int sum = 0;
  for (int i = 0; i < 5; i++)
    sum += num_seq[i];
  return (sum);
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    113f <sum+0x3f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <sum+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
movdqu 0x4(%rdi),%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @sum(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 = %16, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %3
%15 = add nsw i32 %14, %13
store i32 %15, i32* %3
br label %16
16: ; preds = %8
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %5
19: ; preds = %5
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @sum(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = bitcast i32* %3 to <4 x i32>*
%5 = load <4 x i32>, <4 x i32>* %4
%6 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %5)
%7 = add nsw i32 %6, %2
ret i32 %7
}
g(i, j) int *j;
{ return *j + i; }


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

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

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

LLVM IR (-O2):
define i32 @g(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, %0
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ add_command(unsigned int *, int, int);
int /*<<< orphan*/ ipfw_init(int, char **, unsigned int, char const *,
                             int /*<<< orphan*/);
scalar_t__ optind;
int ipfw_list(int args, char **arglist, const char *chain) {
  unsigned int command = 0;
  add_command(&command, 0x0020U, 0x0080U | 0x0800U);
  ipfw_init(args, arglist, command, chain, 0);
  optind = 0;
  return (0);
}


x86 assembly (clang, -O0):
<ipfw_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    -0x1c(%rbp),%rdi
mov    $0x20,%esi
mov    $0x880,%edx
call   1040 <add_command@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <ipfw_init@plt>
mov    0x2e7e(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipfw_list>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x20,%esi
mov    $0x880,%edx
call   1040 <add_command@plt>
mov    0xc(%rsp),%edx
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rcx
xor    %r8d,%r8d
call   1030 <ipfw_init@plt>
mov    0x2e81(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@optind = global i64 0
define i32 @ipfw_list(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* %2, i8** %6
store i32 0, i32* %7
%8 = call i32 @add_command(i32* %7, i32 32, i32 2176)
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
%11 = load i32, i32* %7
%12 = load i8*, i8** %6
%13 = call i32 @ipfw_init(i32 %9, i8** %10, i32 %11, i8* %12, i32 0)
store i64 0, i64* @optind
ret i32 0
}

LLVM IR (-O2):
@optind = global i64 0
define i32 @ipfw_list(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = call i32 @add_command(i32* %4, i32 32, i32 2176)
%7 = load i32, i32* %4
%8 = call i32 @ipfw_init(i32 %0, i8** %1, i32 %7, i8* %2, i32 0)
store i64 0, i64* @optind
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void regerror(char *s) { fprintf(stderr, "regex error: %s\n", s); }


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"regex error: %s\0A\00"
define void @regerror(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"regex error: %s\0A\00"
define void @regerror(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
unsigned int uart_getc(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @uart_getc() {
ret i32 0
}

LLVM IR (-O2):
define i32 @uart_getc() {
ret i32 0
}
/* Type definitions */
struct IODriver {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct IODriver *);
int /*<<< orphan*/ printf(char *);
void FileIo_Destroy(struct IODriver *driver) {
  free(driver);
  do {
    printf("FileIo: Driver destroyed\n");
  } while (0);
}


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

x86 assembly (clang, -O2):
<FileIo_Destroy>:
push   %rax
call   1030 <free@plt>
lea    0xed3(%rip),%rdi
pop    %rax
jmp    1040 <puts@plt>

LLVM IR (-O0):
%struct.IODriver = type { i32 }
@.str = [26 x i8] c"FileIo: Driver destroyed\0A\00"
define void @FileIo_Destroy(%struct.IODriver* %0) {
%2 = alloca %struct.IODriver*
store %struct.IODriver* %0, %struct.IODriver** %2
%3 = load %struct.IODriver*, %struct.IODriver** %2
%4 = call i32 @free(%struct.IODriver* %3)
br label %5
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5
ret void
}

LLVM IR (-O2):
%struct.IODriver = type { i32 }
@str = [25 x i8] c"FileIo: Driver destroyed\00"
define void @FileIo_Destroy(%struct.IODriver* nocapture %0) {
%2 = tail call i32 @free(%struct.IODriver* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
int compress() { return 0; }


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

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

LLVM IR (-O0):
define i32 @compress() {
ret i32 0
}

LLVM IR (-O2):
define i32 @compress() {
ret i32 0
}
void foo326() {}


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

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

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

LLVM IR (-O2):
define void @foo326() {
ret void
}
void test_signed() {
  struct S {
    unsigned a;
    signed b;
    int c;
  };
}


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

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

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

LLVM IR (-O2):
define void @test_signed() {
ret void
}
int xmlUCSIsEnclosedAlphanumerics(int code) {
  return (((code >= 0x2460) && (code <= 0x24FF)));
}


x86 assembly (clang, -O0):
<xmlUCSIsEnclosedAlphanumerics>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x2460,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsEnclosedAlphanumerics+0x26>
cmpl   $0x24ff,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmlUCSIsEnclosedAlphanumerics>:
add    $0xffffdba0,%edi
xor    %eax,%eax
cmp    $0xa0,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @xmlUCSIsEnclosedAlphanumerics(i32 %0) {
%2 = add i32 %0, -9312
%3 = icmp ult i32 %2, 160
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ run_tests();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int main() {
  srand(0);
  run_tests();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @srand(i32 0)
%2 = tail call i32 (...) @run_tests()
ret i32 0
}
/* Variables and functions */
int sin(double);
double sqrt(double);
double GeogBeamHt(double d, double tilt, double a0) {
  return sqrt(a0 * a0 + 2 * a0 * d * sin(tilt) + d * d) - a0;
}


x86 assembly (clang, -O0):
<GeogBeamHt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xead(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
cvtsi2sd %eax,%xmm3
mulsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
subsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GeogBeamHt>:
sub    $0x18,%rsp
movsd  %xmm2,(%rsp)
movsd  %xmm0,0x10(%rsp)
addsd  %xmm2,%xmm2
mulsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
movaps %xmm1,%xmm0
call   1030 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm2
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
movapd %xmm2,%xmm0
jb     1181 <GeogBeamHt+0x61>
sqrtsd %xmm0,%xmm0
jmp    1186 <GeogBeamHt+0x66>
call   1040 <sqrt@plt>
subsd  (%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @GeogBeamHt(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %6
%8 = load double, double* %6
%9 = load double, double* %6
%10 = fmul double 2.000000e+00, %9
%11 = load double, double* %4
%12 = fmul double %10, %11
%13 = load double, double* %5
%14 = call i32 @sin(double %13)
%15 = sitofp i32 %14 to double
%16 = fmul double %12, %15
%17 = call double @llvm.fmuladd.f64(double %7, double %8, double %16)
%18 = load double, double* %4
%19 = load double, double* %4
%20 = call double @llvm.fmuladd.f64(double %18, double %19, double %17)
%21 = call double @sqrt(double %20)
%22 = load double, double* %6
%23 = fsub double %21, %22
ret double %23
}

LLVM IR (-O2):
define double @GeogBeamHt(double %0, double %1, double %2) {
%4 = fmul double %2, 2.000000e+00
%5 = fmul double %4, %0
%6 = tail call i32 @sin(double %1)
%7 = sitofp i32 %6 to double
%8 = fmul double %5, %7
%9 = tail call double @llvm.fmuladd.f64(double %2, double %2, double %8)
%10 = tail call double @llvm.fmuladd.f64(double %0, double %0, double %9)
%11 = tail call double @sqrt(double %10)
%12 = fsub double %11, %2
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char value[3] = {'\0'};
  printf("%s\n", value);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x7(%rbp),%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1040 <memset@plt>
lea    -0x7(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movb   $0x0,0x6(%rsp)
movw   $0x0,0x4(%rsp)
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [3 x i8]
%2 = getelementptr inbounds [3 x i8], [3 x i8]* %1, i64 0, i64 0
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}
int doMULT(int v1, int v2) { return v1 * v2; }


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

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

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

LLVM IR (-O2):
define i32 @doMULT(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ swap(int *, int *);
int main() {
  int num1 = 10, num2 = 20;
  printf("%d\t%d\n", num1, num2);
  swap(&num1, &num2);
  printf("%d\t%d\n", num1, num2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xa,-0x8(%rbp)
movl   $0x14,-0xc(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <swap@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0xa,0xc(%rsp)
movl   $0x14,0x8(%rsp)
lea    0xec4(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
mov    $0x14,%edx
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <swap@plt>
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d\09%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 20, i32* %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 10, i32 20)
%6 = call i32 @swap(i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
ret i32 0
}
/* Type definitions */
struct tms {
  float tms_stime;
};

/* Variables and functions */
int /*<<< orphan*/ _SC_CLK_TCK;
scalar_t__ sysconf(int /*<<< orphan*/);
int /*<<< orphan*/ times(struct tms *);
float report_sys_time() {
  struct tms buffer;
  float systime;
  times(&buffer);
  systime = (buffer.tms_stime) / (float)sysconf(_SC_CLK_TCK);
  return (systime);
}


x86 assembly (clang, -O0):
<report_sys_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1030 <times@plt>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
movss  -0x10(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_sys_time>:
push   %rax
mov    %rsp,%rdi
call   1030 <times@plt>
movss  (%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <sysconf@plt>
cvtsi2ss %rax,%xmm1
movss  0x4(%rsp),%xmm0
divss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.tms = type { float }
@_SC_CLK_TCK = global i32 0
define float @report_sys_time() {
%1 = alloca %struct.tms
%2 = alloca float
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i32 0, i32 0
%5 = load float, float* %4
%6 = load i32, i32* @_SC_CLK_TCK
%7 = call i64 @sysconf(i32 %6)
%8 = sitofp i64 %7 to float
%9 = fdiv float %5, %8
store float %9, float* %2
%10 = load float, float* %2
ret float %10
}

LLVM IR (-O2):
%struct.tms = type { float }
@_SC_CLK_TCK = global i32 0
define float @report_sys_time() {
%1 = alloca %struct.tms
%2 = bitcast %struct.tms* %1 to i8*
%3 = call i32 @times(%struct.tms* %1)
%4 = getelementptr inbounds %struct.tms, %struct.tms* %1, i64 0, i32 0
%5 = load float, float* %4
%6 = load i32, i32* @_SC_CLK_TCK
%7 = tail call i64 @sysconf(i32 %6)
%8 = sitofp i64 %7 to float
%9 = fdiv float %5, %8
ret float %9
}
/* Variables and functions */
short find_pattern(char *, int, char *, int);
int strlen(char *);
short proximity_strcmp(char *string1, char *string2) {
  short total;
  total = find_pattern(string1, strlen(string1), string2, strlen(string2));
  return (2 * 100 * total) / (strlen(string1) + strlen(string2));
}


x86 assembly (clang, -O0):
<proximity_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x28(%rbp),%rdx
mov    %eax,%ecx
call   1030 <find_pattern@plt>
mov    %ax,-0x12(%rbp)
movswl -0x12(%rbp),%eax
imul   $0xc8,%eax,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%ecx
mov    %eax,%edx
mov    -0x18(%rbp),%eax
add    %edx,%ecx
cltd
idiv   %ecx
cwtl
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proximity_strcmp>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
mov    %eax,%ecx
call   1030 <find_pattern@plt>
cwtl
imul   $0xc8,%eax,%ebp
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
add    %ebx,%ecx
mov    %ebp,%eax
cltd
idiv   %ecx
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define signext i16 @proximity_strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i16
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = load i8*, i8** %4
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
%12 = call signext i16 @find_pattern(i8* %6, i32 %8, i8* %9, i32 %11)
store i16 %12, i16* %5
%13 = load i16, i16* %5
%14 = sext i16 %13 to i32
%15 = mul nsw i32 200, %14
%16 = load i8*, i8** %3
%17 = call i32 @strlen(i8* %16)
%18 = load i8*, i8** %4
%19 = call i32 @strlen(i8* %18)
%20 = add nsw i32 %17, %19
%21 = sdiv i32 %15, %20
%22 = trunc i32 %21 to i16
ret i16 %22
}

LLVM IR (-O2):
define signext i16 @proximity_strcmp(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call signext i16 @find_pattern(i8* %0, i32 %3, i8* %1, i32 %4)
%6 = sext i16 %5 to i32
%7 = mul nsw i32 %6, 200
%8 = tail call i32 @strlen(i8* %0)
%9 = tail call i32 @strlen(i8* %1)
%10 = add nsw i32 %9, %8
%11 = sdiv i32 %7, %10
%12 = trunc i32 %11 to i16
ret i16 %12
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
void write_u16_be(unsigned char *buf, uint16_t n) {
  buf[0] = n >> 8 & 0xff;
  buf[1] = n & 0xff;
}


x86 assembly (clang, -O0):
<write_u16_be>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_u16_be>:
rol    $0x8,%si
mov    %si,(%rdi)
ret

LLVM IR (-O0):
define void @write_u16_be(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 8
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = and i32 %11, 255
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 1
store i8 %13, i8* %15
ret void
}

LLVM IR (-O2):
define void @write_u16_be(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 8
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = trunc i32 %1 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
ret void
}
/* Variables and functions */
int EphemeralKeyGeneration_B_extended(unsigned char const *, unsigned char *,
                                      int /*<<< orphan*/);
int EphemeralKeyGeneration_B(const unsigned char *PrivateKeyB,
                             unsigned char *CompressedPKB) {
  return EphemeralKeyGeneration_B_extended(PrivateKeyB, CompressedPKB, 0);
}


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

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

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

LLVM IR (-O2):
define i32 @EphemeralKeyGeneration_B(i8* %0, i8* %1) {
%3 = tail call i32 @EphemeralKeyGeneration_B_extended(i8* %0, i8* %1, i32 0)
ret i32 %3
}
void wifi_rsp_endpoint_set_active(
    const struct wifi_msg_endpoint_set_active_rsp_t *msg) {}


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

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

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

LLVM IR (-O2):
%struct.wifi_msg_endpoint_set_active_rsp_t = type opaque
define void @wifi_rsp_endpoint_set_active(%struct.wifi_msg_endpoint_set_active_rsp_t* nocapture %0) {
ret void
}
void BLE_bless_isr_Interrupt(void) {}


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

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

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

LLVM IR (-O2):
define void @BLE_bless_isr_Interrupt() {
ret void
}
/* Variables and functions */
int EFAULT;
int /*<<< orphan*/ mem_ref_is_safe(void const *, size_t);
int /*<<< orphan*/ printf(char *, void const *, size_t);
int check_extent(const void *ptr, size_t len) {
  if (!mem_ref_is_safe(ptr, len)) {
    printf("sandbox: mem ref with addr %p, len %lx is out of range\n", ptr,
           len);
    return -EFAULT;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_extent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <mem_ref_is_safe@plt>
cmp    $0x0,%eax
jne    116d <check_extent+0x4d>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
mov    0x2e95(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1174 <check_extent+0x54>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_extent>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <mem_ref_is_safe@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jne    1154 <check_extent+0x34>
lea    0xec2(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <printf@plt>
mov    0x2ea8(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [56 x i8] c"sandbox: mem ref with addr %p, len %lx is out of range\0A\00"
@EFAULT = global i32 0
define i32 @check_extent(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
%6 = load i8*, i8** %4
%7 = load i64, i64* %5
%8 = call i32 @mem_ref_is_safe(i8* %6, i64 %7)
%9 = icmp ne i32 %8, 0
br i1 %9, label %16, label %10
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i64, i64* %5
%13 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %11, i64 %12)
%14 = load i32, i32* @EFAULT
%15 = sub nsw i32 0, %14
store i32 %15, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %10
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [56 x i8] c"sandbox: mem ref with addr %p, len %lx is out of range\0A\00"
@EFAULT = global i32 0
define i32 @check_extent(i8* %0, i64 %1) {
%3 = tail call i32 @mem_ref_is_safe(i8* %0, i64 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
%7 = load i32, i32* @EFAULT
%8 = sub nsw i32 0, %7
br label %9
9: ; preds = %2, %5
%10 = phi i32 [ %8, %5 ], [ 0, %2 ]
ret i32 %10
}
void g_realloc() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @fn_default_start() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void g(int garg) {
  int glocal = 99;
  puts("Inside g");
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x63,-0x8(%rbp)
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"Inside g\00"
define void @g(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret void
}
void foo819() {}


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

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

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

LLVM IR (-O2):
define void @foo819() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ showinfo();
int main() {
  showinfo();
  exit(0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @showinfo()
%2 = tail call i32 @exit(i32 0)
unreachable
}
int SizeBMov(int x) {
  if (x == 0)
    return 3;
  else if (x < 256)
    return 4;
  else
    return 7;
}


x86 assembly (clang, -O0):
<SizeBMov>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <SizeBMov+0x1d>
movl   $0x3,-0x4(%rbp)
jmp    113d <SizeBMov+0x3d>
cmpl   $0x100,-0x8(%rbp)
jge    1136 <SizeBMov+0x36>
movl   $0x4,-0x4(%rbp)
jmp    113d <SizeBMov+0x3d>
movl   $0x7,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SizeBMov>:
xor    %eax,%eax
cmp    $0x100,%edi
setge  %al
lea    (%rax,%rax,2),%ecx
or     $0x4,%ecx
test   %edi,%edi
mov    $0x3,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @SizeBMov(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 3, i32* %2
br label %12
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 256
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 4, i32* %2
br label %12
11: ; preds = %7
store i32 7, i32* %2
br label %12
12: ; preds = %11, %10, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @SizeBMov(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = icmp slt i32 %0, 256
%4 = select i1 %3, i32 4, i32 7
%5 = select i1 %2, i32 3, i32 %4
ret i32 %5
}
adrx0indreg1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((((unsigned int *)10000000)[x0]) <= (*p1))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<adrx0indreg1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
mov    (%rax,%rcx,4),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
ja     113c <adrx0indreg1+0x3c>
movl   $0x1,-0x4(%rbp)
jmp    1143 <adrx0indreg1+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0indreg1>:
movslq %edx,%rax
mov    0x989680(,%rax,4),%ecx
xor    %eax,%eax
cmp    (%r9),%ecx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @adrx0indreg1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture readnone %4, i32* nocapture %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* inttoptr (i64 10000000 to i32*), i64 %7
%9 = load i32, i32* %8
%10 = load i32, i32* %5
%11 = icmp ule i32 %9, %10
%12 = zext i1 %11 to i32
ret i32 %12
}
void io_wait(void) { asm volatile("outb %al, $0x80"); }


x86 assembly (clang, -O0):
<io_wait>:
push   %rbp
mov    %rsp,%rbp
out    %al,$0x80
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_wait>:
out    %al,$0x80
ret

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

LLVM IR (-O2):
define void @io_wait() {
tail call void asm sideeffect "outb %al, $$0x80", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
void handle_irq(void) { return; }


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

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

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

LLVM IR (-O2):
define void @handle_irq() {
ret void
}
int strlen2(char *s) {
  int comprimento;
  for (comprimento = 0; *s != '\0'; ++comprimento, s++)
    ;
  return comprimento;
}


x86 assembly (clang, -O0):
<strlen2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     113e <strlen2+0x3e>
jmp    1124 <strlen2+0x24>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <strlen2+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen2>:
cmpb   $0x0,(%rdi)
je     111c <strlen2+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen2+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @strlen2(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i8*, i8** %2
%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 = %4
br label %10
10: ; preds = %9
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i32 1
store i8* %14, i8** %2
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
define i32 @strlen2(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
void XcmsCIELabClipLab() {}


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

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

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

LLVM IR (-O2):
define void @XcmsCIELabClipLab() {
ret void
}
/* Type definitions */
struct dirent {
  int d_reclen;
};

/* Variables and functions */
int sizeCmp(void *a, void *b) {
  return ((*(struct dirent **)b)->d_reclen - (*(struct dirent **)a)->d_reclen);
}


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

x86 assembly (clang, -O2):
<sizeCmp>:
mov    (%rsi),%rax
mov    (%rax),%eax
mov    (%rdi),%rcx
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.dirent = type { i32 }
define i32 @sizeCmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to %struct.dirent**
%7 = load %struct.dirent*, %struct.dirent** %6
%8 = getelementptr inbounds %struct.dirent, %struct.dirent* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = load i8*, i8** %3
%11 = bitcast i8* %10 to %struct.dirent**
%12 = load %struct.dirent*, %struct.dirent** %11
%13 = getelementptr inbounds %struct.dirent, %struct.dirent* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = sub nsw i32 %9, %14
ret i32 %15
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
define i32 @sizeCmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %1 to %struct.dirent**
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = bitcast i8* %0 to %struct.dirent**
%8 = load %struct.dirent*, %struct.dirent** %7
%9 = getelementptr inbounds %struct.dirent, %struct.dirent* %8, i64 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %6, %10
ret i32 %11
}
void gtk_tree_model_filter_convert_child_iter_to_iter() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_model_filter_convert_child_iter_to_iter() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ p264_pixel_avg_w8_mmxext(int /*<<< orphan*/ *, int,
                                            int /*<<< orphan*/ *, int,
                                            int /*<<< orphan*/ *, int, int);
void p264_pixel_avg_8x4_mmxext(uint8_t *dst, int i_dst, uint8_t *src,
                               int i_src) {
  p264_pixel_avg_w8_mmxext(dst, i_dst, dst, i_dst, src, i_src, 4);
}


x86 assembly (clang, -O0):
<p264_pixel_avg_8x4_mmxext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%r8
mov    -0x1c(%rbp),%r9d
movl   $0x4,(%rsp)
call   1030 <p264_pixel_avg_w8_mmxext@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<p264_pixel_avg_8x4_mmxext>:
push   %rax
mov    %ecx,%r9d
mov    %rdx,%r8
movl   $0x4,(%rsp)
mov    %rdi,%rdx
mov    %esi,%ecx
call   1030 <p264_pixel_avg_w8_mmxext@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @p264_pixel_avg_8x4_mmxext(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %6
%13 = load i32*, i32** %7
%14 = load i32, i32* %8
%15 = call i32 @p264_pixel_avg_w8_mmxext(i32* %9, i32 %10, i32* %11, i32 %12, i32* %13, i32 %14, i32 4)
ret void
}

LLVM IR (-O2):
define void @p264_pixel_avg_8x4_mmxext(i32* %0, i32 %1, i32* %2, i32 %3) {
%5 = tail call i32 @p264_pixel_avg_w8_mmxext(i32* %0, i32 %1, i32* %0, i32 %1, i32* %2, i32 %3, i32 4)
ret void
}