xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float, char, char *);
int /*<<< orphan*/ scanf(char *, float *, char *, char *);
int main() {
  float a;
  char b, c[10];
  scanf("%f %c %s", &a, &b, c);
  printf("%f %c %s", a, b, c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x13(%rbp),%rcx
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x9(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
mov    -0x9(%rbp),%al
lea    -0x13(%rbp),%rdx
lea    0xea6(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xed2(%rip),%rbx
lea    0x8(%rsp),%rsi
lea    0x7(%rsp),%rdx
lea    0xe(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rcx
call   1040 <scanf@plt>
movss  0x8(%rsp),%xmm0
movsbl 0x7(%rsp),%esi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%f %c %s\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i8
%3 = alloca [10 x i8]
%4 = bitcast float* %1 to i8*
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float* %1, i8* %2, i8* %5)
%7 = load float, float* %1
%8 = load i8, i8* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), float %7, i8 signext %8, i8* %5)
ret i32 0
}
int iswhite(int c) { return c == ' ' || c == '\r' || c == '\n' || c == '\t'; }


x86 assembly (clang, -O0):
<iswhite>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <iswhite+0x3e>
mov    $0x1,%al
cmpl   $0xd,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <iswhite+0x3e>
mov    $0x1,%al
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     113e <iswhite+0x3e>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswhite>:
cmp    $0x20,%edi
ja     111d <iswhite+0x1d>
mov    $0x1,%eax
mov    %edi,%ecx
movabs $0x100002400,%rdx
bt     %rcx,%rdx
jae    111d <iswhite+0x1d>
ret
xor    %eax,%eax
cmp    $0x9,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @iswhite(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 13, label %5
i32 10, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 9
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %6
}
void ExttGatewayAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttGatewayAuxTable() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
unsigned int sleep3(int);
int main(void) {
  printf("Going to sleep for 5 seconds.\n");
  unsigned int sleep_left = sleep3(5);
  printf("Woke up after %u seconds.\n", 5 - sleep_left);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%ebx
mov    $0x5,%edi
call   1050 <sleep3@plt>
sub    %eax,%ebx
lea    0xeab(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Going to sleep for 5 seconds.\0A\00"
@.str.1 = [27 x i8] c"Woke up after %u seconds.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep3(i32 5)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = sub i32 5, %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"Woke up after %u seconds.\0A\00"
@str = [30 x i8] c"Going to sleep for 5 seconds.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep3(i32 5)
%3 = sub i32 5, %2
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(int code) {
  printf("Usage: realpath <file>\n");
  exit(code);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"Usage: realpath <file>\0A\00"
define void @usage(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @exit(i32 %4)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"Usage: realpath <file>\00"
define void @usage(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 %0)
unreachable
}
void foo169(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo169(i32 %0) {
ret void
}
/* Variables and functions */
char *getPermutation(int, int);
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("%s\n", getPermutation(3, 5));
  return (0);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x3,%edi
mov    $0x5,%esi
call   1040 <getPermutation@plt>
lea    0xec9(%rip),%rdi
mov    %rax,%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
store i32 0, i32* %1
%2 = call i8* @getPermutation(i32 3, i32 5)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @getPermutation(i32 3, i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
const char *cloog_version(void) {
  return "CLooG "
         "0.15"
         " "
         "64"
         " bits";
}


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

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

LLVM IR (-O0):
@.str = [19 x i8] c"CLooG 0.15 64 bits\00"
define i8* @cloog_version() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [19 x i8] c"CLooG 0.15 64 bits\00"
define i8* @cloog_version() {
ret i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0)
}
OP(ed, ec) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello world from QA updated bundle a!\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 = [39 x i8] c"Hello world from QA updated bundle a!\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 ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [38 x i8] c"Hello world from QA updated bundle a!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_fspath_is_absolute();
void test_fspath() { test_fspath_is_absolute(); }


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

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

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

LLVM IR (-O2):
define void @test_fspath() {
%1 = tail call i32 (...) @test_fspath_is_absolute()
ret void
}
/* Variables and functions */
int *malloc(int);
void mallocMalloc() {
  int *p = malloc(12);
  p = malloc(12);
}


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

x86 assembly (clang, -O2):
<mallocMalloc>:
push   %rax
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    $0xc,%edi
pop    %rax
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define void @mallocMalloc() {
%1 = alloca i32*
%2 = call i32* @malloc(i32 12)
store i32* %2, i32** %1
%3 = call i32* @malloc(i32 12)
store i32* %3, i32** %1
ret void
}

LLVM IR (-O2):
define void @mallocMalloc() {
%1 = tail call i32* @malloc(i32 12)
%2 = tail call i32* @malloc(i32 12)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SD_setBlock(unsigned char *);
int /*<<< orphan*/ SD_setPointer(unsigned char *);
void SD_setAddress(unsigned char *adr) {
  SD_setBlock(adr);
  SD_setPointer(&adr[2]);
}


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

x86 assembly (clang, -O2):
<SD_setAddress>:
push   %rbx
mov    %rdi,%rbx
call   1040 <SD_setBlock@plt>
add    $0x2,%rbx
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <SD_setPointer@plt>

LLVM IR (-O0):
define void @SD_setAddress(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @SD_setBlock(i8* %3)
%5 = load i8*, i8** %2
%6 = getelementptr inbounds i8, i8* %5, i64 2
%7 = call i32 @SD_setPointer(i8* %6)
ret void
}

LLVM IR (-O2):
define void @SD_setAddress(i8* %0) {
%2 = tail call i32 @SD_setBlock(i8* %0)
%3 = getelementptr inbounds i8, i8* %0, i64 2
%4 = tail call i32 @SD_setPointer(i8* %3)
ret void
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
long int getCurrentTime() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec * 1000 + tv.tv_usec / 1000;
}


x86 assembly (clang, -O0):
<getCurrentTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,-0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getCurrentTime>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq (%rsp),%rax
imul   $0x3e8,%rax,%rcx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
cltq
add    %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i64 @getCurrentTime() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = sdiv i32 %7, 1000
%9 = add nsw i32 %5, %8
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i64 @getCurrentTime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
%11 = sext i32 %10 to i64
ret i64 %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ perror(char const *);
int /*<<< orphan*/ stderr;
void xperror(const char *msg) {
  if (msg == NULL) {
    perror("txtcmp");
  } else {
    fprintf(stderr, "txtcmp"
                    ": ");
    perror(msg);
  }
}


x86 assembly (clang, -O0):
<xperror>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1148 <xperror+0x28>
lea    0xec2(%rip),%rdi
call   1040 <perror@plt>
jmp    1166 <xperror+0x46>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <perror@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xperror>:
test   %rdi,%rdi
jne    1131 <xperror+0x11>
lea    0xed4(%rip),%rdi
jmp    1040 <perror@plt>
push   %rbx
mov    %rdi,%rbx
mov    0x2ea4(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1030 <fprintf@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <perror@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"txtcmp\00"
@stderr = global i32 0
@.str.1 = [9 x i8] c"txtcmp: \00"
define void @xperror(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %9
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @perror(i8* %0)
br label %9
9: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int const uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ndm_endian_is_le();
uint32_t ndm_endian_betoh32(const uint32_t x) {
  if (!ndm_endian_is_le()) {
    return x;
  }
  const uint8_t *p = (const uint8_t *)&x;
  return (uint32_t)(((uint32_t) * (p + 3)) << 0 | ((uint32_t) * (p + 2)) << 8 |
                    ((uint32_t) * (p + 1)) << 16 |
                    ((uint32_t) * (p + 0)) << 24);
}


x86 assembly (clang, -O0):
<ndm_endian_betoh32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <ndm_endian_is_le@plt>
cmp    $0x0,%eax
jne    1136 <ndm_endian_betoh32+0x26>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1172 <ndm_endian_betoh32+0x62>
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
shl    $0x0,%eax
mov    -0x10(%rbp),%rcx
mov    0x10(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ndm_endian_betoh32>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <ndm_endian_is_le@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ndm_endian_betoh32(i32 returned %0) {
%2 = tail call i32 (...) @ndm_endian_is_le()
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ stl_logname(char *);
void stl_loginit(char *name) {
  static int initialized = 0;
  stl_logname(name);
  initialized = 1;
}


x86 assembly (clang, -O0):
<stl_loginit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <stl_logname@plt>
movl   $0x1,0x2efd(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stl_loginit>:
jmp    1030 <stl_logname@plt>

LLVM IR (-O0):
@stl_loginit.initialized = internal global i32 0
define void @stl_loginit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @stl_logname(i8* %3)
store i32 1, i32* @stl_loginit.initialized
ret void
}

LLVM IR (-O2):
define void @stl_loginit(i8* %0) {
%2 = tail call i32 @stl_logname(i8* %0)
ret void
}
unsigned char *generate_random_valid_port() {
  char *res = 0x00;
  return res;
}


x86 assembly (clang, -O0):
<generate_random_valid_port>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @generate_random_valid_port() {
%1 = alloca i8*
store i8* null, i8** %1
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @generate_random_valid_port() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ abort();
__attribute__((no)) int main1(int *ib) {
  int i;
  int ia[8];
  for (i = 0; i < 8; i++) {
    ia[i] = ib[i + 8];
  }
  for (i = 0; i < 8; i++) {
    if (ia[i] != ib[i + 8])
      abort();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    1153 <main1+0x43>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x8,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <main1+0x13>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    119c <main1+0x8c>
movslq -0xc(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
add    $0x8,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
je     1189 <main1+0x79>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    118e <main1+0x7e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115a <main1+0x4a>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main1(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca [8 x i32]
store i32* %0, i32** %2
store i32 0, i32* %3
br label %5
5: ; preds = %18, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 8
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i32, i32* %13
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %16
store i32 %14, i32* %17
br label %18
18: ; preds = %8
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %5
21: ; preds = %5
store i32 0, i32* %3
br label %22
22: ; preds = %40, %21
%23 = load i32, i32* %3
%24 = icmp slt i32 %23, 8
br i1 %24, label %25, label %43
25: ; preds = %22
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [8 x i32], [8 x i32]* %4, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = load i32*, i32** %2
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 8
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %30, i64 %33
%35 = load i32, i32* %34
%36 = icmp ne i32 %29, %35
br i1 %36, label %37, label %39
37: ; preds = %25
%38 = call i32 (...) @abort()
unreachable
39: ; preds = %25
br label %40
40: ; preds = %39
%41 = load i32, i32* %3
%42 = add nsw i32 %41, 1
store i32 %42, i32* %3
br label %22
43: ; preds = %22
ret i32 0
}

LLVM IR (-O2):
define i32 @main1(i32* nocapture %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glClearColor(int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ glEnable(int);
int /*<<< orphan*/ memset(int, int /*<<< orphan*/, int);
void proc2() {
  glClearColor(0, 0x3f000000, 0x3f333333, 0x3f800000);
  glEnable(0xb71);
  memset(0x804c280, 0, 500);
  memset(0x804ca50, 0, 4);
  return;
}


x86 assembly (clang, -O0):
<proc2>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x3f000000,%esi
mov    $0x3f333333,%edx
mov    $0x3f800000,%ecx
call   1050 <glClearColor@plt>
mov    $0xb71,%edi
call   1030 <glEnable@plt>
mov    $0x804c280,%edi
xor    %esi,%esi
mov    $0x1f4,%edx
call   1040 <memset@plt>
mov    $0x804ca50,%edi
xor    %esi,%esi
mov    $0x4,%edx
call   1040 <memset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<proc2>:
push   %rax
xor    %edi,%edi
mov    $0x3f000000,%esi
mov    $0x3f333333,%edx
mov    $0x3f800000,%ecx
call   1050 <glClearColor@plt>
mov    $0xb71,%edi
call   1030 <glEnable@plt>
mov    $0x804c280,%edi
xor    %esi,%esi
mov    $0x1f4,%edx
call   1040 <memset@plt>
mov    $0x804ca50,%edi
xor    %esi,%esi
mov    $0x4,%edx
pop    %rax
jmp    1040 <memset@plt>

LLVM IR (-O0):
define void @proc2() {
%1 = call i32 @glClearColor(i32 0, i32 1056964608, i32 1060320051, i32 1065353216)
%2 = call i32 @glEnable(i32 2929)
%3 = call i32 @memset(i32 134529664, i32 0, i32 500)
%4 = call i32 @memset(i32 134531664, i32 0, i32 4)
ret void
}

LLVM IR (-O2):
define void @proc2() {
%1 = tail call i32 @glClearColor(i32 0, i32 1056964608, i32 1060320051, i32 1065353216)
%2 = tail call i32 @glEnable(i32 2929)
%3 = tail call i32 @memset(i32 134529664, i32 0, i32 500)
%4 = tail call i32 @memset(i32 134531664, i32 0, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void CreatePic(unsigned char *pMem) {
  printf("FIXME: CreatePic isnt impelemnted\n");
}


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

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

LLVM IR (-O0):
@.str = [35 x i8] c"FIXME: CreatePic isnt impelemnted\0A\00"
define void @CreatePic(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"FIXME: CreatePic isnt impelemnted\00"
define void @CreatePic(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct hdr_iter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ has_next(struct hdr_iter *);
int /*<<< orphan*/ move_next(struct hdr_iter *);
bool hdr_iter_next(struct hdr_iter *iter) {
  if (!has_next(iter)) {
    return false;
  }
  move_next(iter);
  return true;
}


x86 assembly (clang, -O0):
<hdr_iter_next>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <has_next@plt>
cmp    $0x0,%eax
jne    114a <hdr_iter_next+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    115a <hdr_iter_next+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <move_next@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdr_iter_next>:
push   %rbx
mov    %rdi,%rbx
call   1030 <has_next@plt>
test   %eax,%eax
je     113c <hdr_iter_next+0x1c>
mov    %rbx,%rdi
call   1040 <move_next@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.hdr_iter = type { i32 }
define i32 @hdr_iter_next(%struct.hdr_iter* %0) {
%2 = alloca i32
%3 = alloca %struct.hdr_iter*
store %struct.hdr_iter* %0, %struct.hdr_iter** %3
%4 = load %struct.hdr_iter*, %struct.hdr_iter** %3
%5 = call i32 @has_next(%struct.hdr_iter* %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %11
8: ; preds = %1
%9 = load %struct.hdr_iter*, %struct.hdr_iter** %3
%10 = call i32 @move_next(%struct.hdr_iter* %9)
store i32 1, i32* %2
br label %11
11: ; preds = %8, %7
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
%struct.hdr_iter = type { i32 }
define i32 @hdr_iter_next(%struct.hdr_iter* %0) {
%2 = tail call i32 @has_next(%struct.hdr_iter* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @move_next(%struct.hdr_iter* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
void foo2b() {}


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

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

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

LLVM IR (-O2):
define void @foo2b() {
ret void
}
void cxl_pci_reset_secondary_bus(struct pci_dev *dev) {}


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

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

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

LLVM IR (-O2):
%struct.pci_dev = type opaque
define void @cxl_pci_reset_secondary_bus(%struct.pci_dev* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void aeron_error_log_resource_linger(uint8_t *resource) {}


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

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

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

LLVM IR (-O2):
define void @aeron_error_log_resource_linger(i32* nocapture %0) {
ret void
}
void rop3_120_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = *D & S;
  stk1 = T ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_120_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_120_1_0>:
mov    (%rdi),%al
xor    %dl,%al
and    %sil,%al
xor    %dl,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_120_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8*, i8** %4
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = load i8, i8* %5
%13 = zext i8 %12 to i32
%14 = and i32 %11, %13
%15 = trunc i32 %14 to i8
store i8 %15, i8* %8
%16 = load i8, i8* %6
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = xor i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = load i8, i8* %5
%25 = zext i8 %24 to i32
%26 = xor i32 %25, -1
%27 = and i32 %23, %26
%28 = load i8*, i8** %4
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = load i8, i8* %5
%32 = zext i8 %31 to i32
%33 = and i32 %30, %32
%34 = or i32 %27, %33
%35 = trunc i32 %34 to i8
%36 = load i8*, i8** %4
store i8 %35, i8* %36
ret void
}

LLVM IR (-O2):
define void @rop3_120_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = and i8 %4, %1
%6 = xor i8 %1, -1
%7 = and i8 %6, %2
%8 = or i8 %5, %7
store i8 %8, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ OnEx(unsigned char, unsigned char);
int /*<<< orphan*/ Rev(unsigned char);
int /*<<< orphan*/ SetPower(unsigned char, char);
void OnRevEx(unsigned char Outputs, char Power, unsigned char reset) {
  Rev(Outputs);
  if (Power != -127)
    SetPower(Outputs, Power);
  OnEx(Outputs, reset);
}


x86 assembly (clang, -O0):
<OnRevEx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%cl
mov    %dil,%dl
mov    %dl,-0x1(%rbp)
mov    %cl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <Rev@plt>
movsbl -0x2(%rbp),%eax
cmp    $0xffffff81,%eax
je     116e <OnRevEx+0x3e>
mov    -0x1(%rbp),%al
movzbl %al,%edi
movsbl -0x2(%rbp),%esi
call   1050 <SetPower@plt>
mov    -0x1(%rbp),%al
movzbl %al,%edi
movzbl -0x3(%rbp),%esi
call   1040 <OnEx@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OnRevEx>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
call   1030 <Rev@plt>
movzbl %bl,%ebx
cmp    $0x81,%bpl
je     1154 <OnRevEx+0x24>
movsbl %bpl,%esi
mov    %ebx,%edi
call   1050 <SetPower@plt>
movzbl %r14b,%esi
mov    %ebx,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <OnEx@plt>

LLVM IR (-O0):
define void @OnRevEx(i8 zeroext %0, i8 signext %1, i8 zeroext %2) {
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8 %0, i8* %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%7 = load i8, i8* %4
%8 = call i32 @Rev(i8 zeroext %7)
%9 = load i8, i8* %5
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, -127
br i1 %11, label %12, label %16
12: ; preds = %3
%13 = load i8, i8* %4
%14 = load i8, i8* %5
%15 = call i32 @SetPower(i8 zeroext %13, i8 signext %14)
br label %16
16: ; preds = %12, %3
%17 = load i8, i8* %4
%18 = load i8, i8* %6
%19 = call i32 @OnEx(i8 zeroext %17, i8 zeroext %18)
ret void
}

LLVM IR (-O2):
define void @OnRevEx(i8 zeroext %0, i8 signext %1, i8 zeroext %2) {
%4 = tail call i32 @Rev(i8 zeroext %0)
%5 = icmp eq i8 %1, -127
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @SetPower(i8 zeroext %0, i8 signext %1)
br label %8
8: ; preds = %6, %3
%9 = tail call i32 @OnEx(i8 zeroext %0, i8 zeroext %2)
ret void
}
void send_message() {}


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

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

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

LLVM IR (-O2):
define void @send_message() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ MicroDelay(int);
unsigned short nic_inw(int);
int /*<<< orphan*/ nic_outb(int, int);
unsigned short phy_inw(unsigned char reg) {
  nic_outb(0x0C, 0x40 | reg);
  nic_outb(0x0B, 0x0C);
  MicroDelay(100);
  nic_outb(0x0B, 0x00);
  return nic_inw(0x0D);
}


x86 assembly (clang, -O0):
<phy_inw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%esi
or     $0x40,%esi
mov    $0xc,%edi
call   1050 <nic_outb@plt>
mov    $0xb,%edi
mov    $0xc,%esi
call   1050 <nic_outb@plt>
mov    $0x64,%edi
call   1030 <MicroDelay@plt>
mov    $0xb,%edi
xor    %esi,%esi
call   1050 <nic_outb@plt>
mov    $0xd,%edi
call   1040 <nic_inw@plt>
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phy_inw>:
push   %rax
or     $0x40,%dil
movzbl %dil,%esi
mov    $0xc,%edi
call   1050 <nic_outb@plt>
mov    $0xb,%edi
mov    $0xc,%esi
call   1050 <nic_outb@plt>
mov    $0x64,%edi
call   1030 <MicroDelay@plt>
mov    $0xb,%edi
xor    %esi,%esi
call   1050 <nic_outb@plt>
mov    $0xd,%edi
pop    %rax
jmp    1040 <nic_inw@plt>

LLVM IR (-O0):
define zeroext i16 @phy_inw(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = or i32 64, %4
%6 = call i32 @nic_outb(i32 12, i32 %5)
%7 = call i32 @nic_outb(i32 11, i32 12)
%8 = call i32 @MicroDelay(i32 100)
%9 = call i32 @nic_outb(i32 11, i32 0)
%10 = call zeroext i16 @nic_inw(i32 13)
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @phy_inw(i8 zeroext %0) {
%2 = or i8 %0, 64
%3 = zext i8 %2 to i32
%4 = tail call i32 @nic_outb(i32 12, i32 %3)
%5 = tail call i32 @nic_outb(i32 11, i32 12)
%6 = tail call i32 @MicroDelay(i32 100)
%7 = tail call i32 @nic_outb(i32 11, i32 0)
%8 = tail call zeroext i16 @nic_inw(i32 13)
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int a = 10;
  int b = 20;
  int c;
  c = a + b - 10;
  printf("c=%d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xa,-0x4(%rbp)
movl   $0x14,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec4(%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
mov    $0x14,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"c=%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 20)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ timeout;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_RCVTIMEO;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int fnet_set_recv_timeout(int fd, int timeout) {
  return setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout,
                    sizeof(timeout));
}


x86 assembly (clang, -O0):
<fnet_set_recv_timeout>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ec0(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    -0x8(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnet_set_recv_timeout>:
push   %rax
mov    %esi,0x4(%rsp)
mov    0x2ecc(%rip),%rax
mov    (%rax),%esi
mov    0x2eb3(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_RCVTIMEO = global i32 0
define i32 @fnet_set_recv_timeout(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* @SOL_SOCKET
%7 = load i32, i32* @SO_RCVTIMEO
%8 = bitcast i32* %4 to i8*
%9 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i8* %8, i32 4)
ret i32 %9
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_RCVTIMEO = global i32 0
define i32 @fnet_set_recv_timeout(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_RCVTIMEO
%6 = bitcast i32* %3 to i8*
%7 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i8* %6, i32 4)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ i2c_WriteDataREG(int, unsigned char);
void i2c1_WriteDataREG(unsigned char val) { i2c_WriteDataREG(1, val); }


x86 assembly (clang, -O0):
<i2c1_WriteDataREG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
movzbl -0x1(%rbp),%esi
call   1030 <i2c_WriteDataREG@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @i2c1_WriteDataREG(i8 zeroext %0) {
%2 = tail call i32 @i2c_WriteDataREG(i32 1, i8 zeroext %0)
ret void
}
int check_null_string(char *cp, int len) {
  for (; len > 0; len--) {
    if (*cp++ == '\000')
      break;
  }
  if (len == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<check_null_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1148 <check_null_string+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1135 <check_null_string+0x35>
jmp    1148 <check_null_string+0x48>
jmp    113a <check_null_string+0x3a>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    110b <check_null_string+0xb>
cmpl   $0x0,-0x14(%rbp)
jne    115e <check_null_string+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1165 <check_null_string+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_null_string>:
test   %esi,%esi
jle    1125 <check_null_string+0x25>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,(%rdi)
je     1125 <check_null_string+0x25>
add    $0x1,%rdi
lea    -0x1(%rsi),%eax
cmp    $0x1,%esi
mov    %eax,%esi
jg     1110 <check_null_string+0x10>
xor    %esi,%esi
xor    %eax,%eax
test   %esi,%esi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @check_null_string(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2, %9
%5 = phi i32 [ %11, %9 ], [ %1, %2 ]
%6 = phi i8* [ %10, %9 ], [ %0, %2 ]
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = add nsw i32 %5, -1
%12 = icmp sgt i32 %5, 1
br i1 %12, label %4, label %13
13: ; preds = %9, %4, %2
%14 = phi i32 [ %1, %2 ], [ %5, %4 ], [ 0, %9 ]
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
ret i32 %16
}
void skb_to_sgvec(void) { nsc_assert(0, __func__); }


x86 assembly (clang, -O0):
<skb_to_sgvec>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
lea    0xee3(%rip),%rsi
mov    $0x0,%al
call   1030 <nsc_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<skb_to_sgvec>:
lea    0xee9(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
jmp    1030 <nsc_assert@plt>

LLVM IR (-O0):
@__func__.skb_to_sgvec = [13 x i8] c"skb_to_sgvec\00"
define void @skb_to_sgvec() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.skb_to_sgvec, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__func__.skb_to_sgvec = [13 x i8] c"skb_to_sgvec\00"
define void @skb_to_sgvec() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @nsc_assert to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__func__.skb_to_sgvec, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int S_ISCHR(int /*<<< orphan*/);
int C_S_ISCHR(mode_t mode) { return S_ISCHR(mode); }


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

x86 assembly (clang, -O2):
<C_S_ISCHR>:
jmp    1030 <S_ISCHR@plt>

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

LLVM IR (-O2):
define i32 @C_S_ISCHR(i32 %0) {
%2 = tail call i32 @S_ISCHR(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ f();
void g() { f(); }


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

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

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

LLVM IR (-O2):
define void @g() {
%1 = tail call i32 (...) @f()
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint8_t uart_rx_is_empty(uint32_t *uart) { return uart[0x18 / 4] & 0x10; }


x86 assembly (clang, -O0):
<uart_rx_is_empty>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
and    $0x10,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<uart_rx_is_empty>:
mov    0x18(%rdi),%eax
and    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @uart_rx_is_empty(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 6
%5 = load i32, i32* %4
%6 = and i32 %5, 16
ret i32 %6
}

LLVM IR (-O2):
define i32 @uart_rx_is_empty(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
%4 = and i32 %3, 16
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char const *, char *);
char *hints(const char *buf, int *color, int *bold) {
  if (!strcasecmp(buf, "hello")) {
    *color = 35;
    *bold = 0;
    return " World";
  }
  return NULL;
}


x86 assembly (clang, -O0):
<hints>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed1(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1161 <hints+0x51>
mov    -0x18(%rbp),%rax
movl   $0x23,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
lea    0xeae(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1169 <hints+0x59>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hints>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
lea    0xedf(%rip),%rsi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     112e <hints+0x1e>
xor    %eax,%eax
jmp    1142 <hints+0x32>
movl   $0x23,(%rbx)
movl   $0x0,(%r14)
lea    0xec4(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@.str.1 = [7 x i8] c" World\00"
define i8* @hints(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%8 = load i8*, i8** %5
%9 = call i32 @strcasecmp(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%10 = icmp ne i32 %9, 0
br i1 %10, label %14, label %11
11: ; preds = %3
%12 = load i32*, i32** %6
store i32 35, i32* %12
%13 = load i32*, i32** %7
store i32 0, i32* %13
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8** %4
br label %15
14: ; preds = %3
store i8* null, i8** %4
br label %15
15: ; preds = %14, %11
%16 = load i8*, i8** %4
ret i8* %16
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@.str.1 = [7 x i8] c" World\00"
define i8* @hints(i8* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3
store i32 35, i32* %1
store i32 0, i32* %2
br label %7
7: ; preds = %3, %6
%8 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %6 ], [ null, %3 ]
ret i8* %8
}