xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
int wait(void) {
  printf("wait() not implemented\n");
  exit(-1);
}


x86 assembly (clang, -O0):
<wait>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<wait>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"wait() not implemented\0A\00"
define i32 @wait() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"wait() not implemented\00"
define i32 @wait() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 -1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ lfs1_fromle32(int /*<<< orphan*/);
uint32_t lfs1_tole32(uint32_t a) { return lfs1_fromle32(a); }


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

x86 assembly (clang, -O2):
<lfs1_tole32>:
jmp    1030 <lfs1_fromle32@plt>

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

LLVM IR (-O2):
define i32 @lfs1_tole32(i32 %0) {
%2 = tail call i32 @lfs1_fromle32(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test09_head() {
  do {
    printf("test09");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test09_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test09_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [7 x i8] c"test09\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test09_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test09\00"
define void @test09_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int ishul(char *symbol) {
  if (strcmp(symbol, "HH") == 0) {
    return (1);
  } else
    return (0);
}


x86 assembly (clang, -O0):
<ishul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <ishul+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1149 <ishul+0x39>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishul>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"HH\00"
define i32 @ishul(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct timespec {
  int member_1;
  int /*<<< orphan*/ member_0;
};
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_read;
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
int /*<<< orphan*/ syscall(int /*<<< orphan*/, int, void *, size_t);
ssize_t read(int fildes, void *buf, size_t nbyte) {
  struct timespec s = {0, 50000000};
  (void)nanosleep(&s, NULL);
  return (ssize_t)syscall(SYS_read, fildes, buf, nbyte);
}


x86 assembly (clang, -O0):
<read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0xec6(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1040 <syscall@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
movabs $0x2faf08000000000,%rax
f0 fa 02
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
mov    %ebp,%esi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1040 <syscall@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@__const.read.s = %struct.timespec { i32 0, i32 50000000 }
@SYS_read = global i32 0
define i32 @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca %struct.timespec
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = bitcast %struct.timespec* %7 to i8*
%9 = call i32 @nanosleep(%struct.timespec* %7, i32* null)
%10 = load i32, i32* @SYS_read
%11 = load i32, i32* %4
%12 = load i8*, i8** %5
%13 = load i64, i64* %6
%14 = call i32 @syscall(i32 %10, i32 %11, i8* %12, i64 %13)
ret i32 %14
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@SYS_read = global i32 0
define i32 @read(i32 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = bitcast i64* %4 to %struct.timespec*
%6 = bitcast i64* %4 to i8*
store i64 214748364800000000, i64* %4
%7 = call i32 @nanosleep(%struct.timespec* %5, i32* null)
%8 = load i32, i32* @SYS_read
%9 = call i32 @syscall(i32 %8, i32 %0, i8* %1, i64 %2)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int count;
  printf("This is%n a test program. count : %d \n", &count, count);
  printf("count = %d \n", count);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%rsp),%esi
lea    0xef8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [39 x i8] c"This is%n a test program. count : %d \0A\00"
@.str.1 = [13 x i8] c"count = %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32* %1, i32 %2)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [39 x i8] c"This is%n a test program. count : %d \0A\00"
@.str.1 = [13 x i8] c"count = %d \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i32* %1, i32 undef)
%4 = load i32, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
void HL_ResetMapLoading(void) {}


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

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

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

LLVM IR (-O2):
define void @HL_ResetMapLoading() {
ret void
}
/* Variables and functions */
int gcd(int, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("GCD of 10 & 25 is %d\n", gcd(10, 25));
  printf("Press any key to end...");
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
mov    $0x19,%esi
call   1050 <gcd@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
mov    $0x19,%esi
call   1050 <gcd@plt>
lea    0xeb9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"GCD of 10 & 25 is %d\0A\00"
@.str.1 = [24 x i8] c"Press any key to end...\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @gcd(i32 10, i32 25)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"GCD of 10 & 25 is %d\0A\00"
@.str.1 = [24 x i8] c"Press any key to end...\00"
define i32 @main() {
%1 = tail call i32 @gcd(i32 10, i32 25)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
ret i32 0
}
void d_printf(const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @d_printf(i8* nocapture %0, ...) {
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int opt_resize(char *opt) {
  if (strcmp(opt, "-m") == 0)
    return 1;
  if (strcmp(opt, "--map") == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<opt_resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1142 <opt_resize+0x32>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_resize+0x5f>
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1168 <opt_resize+0x58>
movl   $0x1,-0x4(%rbp)
jmp    116f <opt_resize+0x5f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<opt_resize>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1141 <opt_resize+0x31>
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"-m\00"
@.str.1 = [6 x i8] c"--map\00"
define i32 @opt_resize(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Type definitions */
struct connInfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ errAbort(char *, char *, int);
int udcDataViaTransparent(char *url, unsigned long long offset, int size,
                          void *buffer, struct connInfo *ci) {
  errAbort("Internal error %s %d",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/CRG-Barcelona/libbeato/refs/heads/master/"
           "jkweb/udc.c",
           262);
  return size;
}


x86 assembly (clang, -O0):
<udcDataViaTransparent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0xece(%rip),%rdi
lea    0xedc(%rip),%rsi
mov    $0x106,%edx
call   1030 <errAbort@plt>
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udcDataViaTransparent>:
push   %rbx
mov    %edx,%ebx
lea    0xee6(%rip),%rdi
lea    0xef4(%rip),%rsi
mov    $0x106,%edx
call   1030 <errAbort@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.connInfo = type { i32 }
@.str = [21 x i8] c"Internal error %s %d\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CRG-Barcelona/libbeato/refs/heads/master/jkweb/udc.c\00"
define i32 @udcDataViaTransparent(i8* %0, i64 %1, i32 %2, i8* %3, %struct.connInfo* %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i8*
%10 = alloca %struct.connInfo*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store %struct.connInfo* %4, %struct.connInfo** %10
%11 = call i32 @errAbort(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 262)
%12 = load i32, i32* %8
ret i32 %12
}

LLVM IR (-O2):
%struct.connInfo = type { i32 }
@.str = [21 x i8] c"Internal error %s %d\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/CRG-Barcelona/libbeato/refs/heads/master/jkweb/udc.c\00"
define i32 @udcDataViaTransparent(i8* nocapture readnone %0, i64 %1, i32 returned %2, i8* nocapture readnone %3, %struct.connInfo* nocapture readnone %4) {
%6 = tail call i32 @errAbort(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 262)
ret i32 %2
}
long long sum(long long *tree, long long idx) {
  return idx ? tree[idx] + sum(tree, idx - ((idx) & (-(idx)))) : 0;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116b <sum+0x5b>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    %rcx,%rax
sub    %rax,%rsi
call   1030 <sum@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    1176 <sum+0x66>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1176 <sum+0x66>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
xor    %eax,%eax
test   %rsi,%rsi
je     111d <sum+0x1d>
nopw   0x0(%rax,%rax,1)
lea    -0x1(%rsi),%rcx
add    (%rdi,%rsi,8),%rax
and    %rcx,%rsi
jne    1110 <sum+0x10>
ret

LLVM IR (-O0):
define i64 @sum(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %21
7: ; preds = %2
%8 = load i64*, i64** %3
%9 = load i64, i64* %4
%10 = getelementptr inbounds i64, i64* %8, i64 %9
%11 = load i64, i64* %10
%12 = load i64*, i64** %3
%13 = load i64, i64* %4
%14 = load i64, i64* %4
%15 = load i64, i64* %4
%16 = sub nsw i64 0, %15
%17 = and i64 %14, %16
%18 = sub nsw i64 %13, %17
%19 = call i64 @sum(i64* %12, i64 %18)
%20 = add nsw i64 %11, %19
br label %22
21: ; preds = %2
br label %22
22: ; preds = %21, %7
%23 = phi i64 [ %20, %7 ], [ 0, %21 ]
ret i64 %23
}

LLVM IR (-O2):
define i64 @sum(i64* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %13, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %10, %4 ], [ %1, %2 ]
%6 = phi i64 [ %11, %4 ], [ 0, %2 ]
%7 = getelementptr inbounds i64, i64* %0, i64 %5
%8 = load i64, i64* %7
%9 = add i64 %5, -1
%10 = and i64 %9, %5
%11 = add nsw i64 %8, %6
%12 = icmp eq i64 %10, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %2
%14 = phi i64 [ 0, %2 ], [ %11, %4 ]
ret i64 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
void closeForSeqRead(FILE *inFile) { fclose(inFile); }


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

x86 assembly (clang, -O2):
<closeForSeqRead>:
jmp    1030 <fclose@plt>

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

LLVM IR (-O2):
define void @closeForSeqRead(i32* nocapture %0) {
%2 = tail call i32 @fclose(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UpnpResponseGeneric(void const *, char *, char *, char *);
void UpnpResponse_MediaRenderer_RenderingControl_SetMute(
    const void *UPnPToken) {
  UpnpResponseGeneric(UPnPToken,
                      "urn:schemas-upnp-org:service:RenderingControl:1",
                      "SetMute", "");
}


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

x86 assembly (clang, -O2):
<UpnpResponse_MediaRenderer_RenderingControl_SetMute>:
lea    0xee9(%rip),%rsi
lea    0xf12(%rip),%rdx
lea    0xf0a(%rip),%rcx
jmp    1030 <UpnpResponseGeneric@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"urn:schemas-upnp-org:service:RenderingControl:1\00"
@.str.1 = [8 x i8] c"SetMute\00"
@.str.2 = [1 x i8] zeroinitializer
define void @UpnpResponse_MediaRenderer_RenderingControl_SetMute(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @UpnpResponseGeneric(i8* %3, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [48 x i8] c"urn:schemas-upnp-org:service:RenderingControl:1\00"
@.str.1 = [8 x i8] c"SetMute\00"
@.str.2 = [1 x i8] zeroinitializer
define void @UpnpResponse_MediaRenderer_RenderingControl_SetMute(i8* %0) {
%2 = tail call i32 @UpnpResponseGeneric(i8* %0, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, char *, int);
int /*<<< orphan*/ memmove(unsigned char *, unsigned char *, int);
const char *kb_keyname(unsigned char *key, int n) {
  if (n < 2)
    return NULL;
  memmove(key + 3, key + 1, n);
  memcpy(key, "ESC", 3);
  return (const char *)key;
}


x86 assembly (clang, -O0):
<kb_keyname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
cmpl   $0x2,-0x14(%rbp)
jge    1146 <kb_keyname+0x26>
movq   $0x0,-0x8(%rbp)
jmp    117b <kb_keyname+0x5b>
mov    -0x10(%rbp),%rdi
add    $0x3,%rdi
mov    -0x10(%rbp),%rsi
add    $0x1,%rsi
mov    -0x14(%rbp),%edx
call   1040 <memmove@plt>
mov    -0x10(%rbp),%rdi
lea    0xe97(%rip),%rsi
mov    $0x3,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kb_keyname>:
push   %rbx
cmp    $0x2,%esi
jge    112a <kb_keyname+0xa>
xor    %ebx,%ebx
jmp    1150 <kb_keyname+0x30>
mov    %esi,%edx
mov    %rdi,%rbx
add    $0x3,%rdi
lea    0x1(%rbx),%rsi
call   1040 <memmove@plt>
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
mov    $0x3,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"ESC\00"
define i8* @kb_keyname(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp slt i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i8* null, i8** %3
br label %19
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i64 3
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i32, i32* %5
%15 = call i32 @memmove(i8* %11, i8* %13, i32 %14)
%16 = load i8*, i8** %4
%17 = call i32 @memcpy(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%18 = load i8*, i8** %4
store i8* %18, i8** %3
br label %19
19: ; preds = %9, %8
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
@.str = [4 x i8] c"ESC\00"
define i8* @kb_keyname(i8* %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8, i8* %0, i64 3
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = tail call i32 @memmove(i8* %5, i8* %6, i32 %1)
%8 = tail call i32 @memcpy(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
br label %9
9: ; preds = %2, %4
%10 = phi i8* [ %0, %4 ], [ null, %2 ]
ret i8* %10
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_t;
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ __real_pthread_create(int /*<<< orphan*/ *,
                                         int /*<<< orphan*/ const *,
                                         void *(*)(void *), void *);
int __call_real_pthread_create(pthread_t *thread, const pthread_attr_t *attr,
                               void *(*start_routine)(void *), void *arg) {
  __real_pthread_create(thread, attr, start_routine, arg);
}


x86 assembly (clang, -O0):
<__call_real_pthread_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1030 <__real_pthread_create@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__call_real_pthread_create>:
jmp    1030 <__real_pthread_create@plt>

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

LLVM IR (-O2):
define i32 @__call_real_pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3) {
%5 = tail call i32 @__real_pthread_create(i32* %0, i32* %1, i8* (i8*)* %2, i8* %3)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ debugPrint(char *);
int /*<<< orphan*/ next_glReleaseShaderCompiler();
int /*<<< orphan*/ printGLError();
void glReleaseShaderCompiler() {
  next_glReleaseShaderCompiler();
  printGLError();
  debugPrint("glReleaseShaderCompiler()\n");
}


x86 assembly (clang, -O0):
<glReleaseShaderCompiler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <next_glReleaseShaderCompiler@plt>
mov    $0x0,%al
call   1040 <printGLError@plt>
lea    0xeb7(%rip),%rdi
call   1050 <debugPrint@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glReleaseShaderCompiler>:
push   %rax
xor    %eax,%eax
call   1030 <next_glReleaseShaderCompiler@plt>
xor    %eax,%eax
call   1040 <printGLError@plt>
lea    0xeba(%rip),%rdi
pop    %rax
jmp    1050 <debugPrint@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"glReleaseShaderCompiler()\0A\00"
define void @glReleaseShaderCompiler() {
%1 = call i32 (...) @next_glReleaseShaderCompiler()
%2 = call i32 (...) @printGLError()
%3 = call i32 @debugPrint(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"glReleaseShaderCompiler()\0A\00"
define void @glReleaseShaderCompiler() {
%1 = tail call i32 (...) @next_glReleaseShaderCompiler()
%2 = tail call i32 (...) @printGLError()
%3 = tail call i32 @debugPrint(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret void
}
float foo(float f) { return f; }


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

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

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

LLVM IR (-O2):
define float @foo(float returned %0) {
ret float %0
}
void Reset_config(void) {}


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

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

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

LLVM IR (-O2):
define void @Reset_config() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void clearUnicodeRow(char *row) { memset(row, 0, (1 << 8)); }


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

x86 assembly (clang, -O2):
<clearUnicodeRow>:
xor    %esi,%esi
mov    $0x100,%edx
jmp    1030 <memset@plt>

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

LLVM IR (-O2):
define void @clearUnicodeRow(i8* %0) {
%2 = tail call i32 @memset(i8* %0, i32 0, i32 256)
ret void
}
void gtk_entry_completion_insert_action_markup() {}


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

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

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

LLVM IR (-O2):
define void @gtk_entry_completion_insert_action_markup() {
ret void
}
main() {
  float f;
  double d;
  f = 1;
  d = f;
  f = d;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movss  0xef4(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca float
%2 = alloca double
store float 1.000000e+00, float* %1
%3 = load float, float* %1
%4 = fpext float %3 to double
store double %4, double* %2
%5 = load double, double* %2
%6 = fptrunc double %5 to float
store float %6, float* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sayHello(char *);
int main() {
  sayHello("bbbbb");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"bbbbb\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @sayHello(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"bbbbb\00"
define i32 @main() {
%1 = tail call i32 @sayHello(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void rop3_206_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~T;
  stk2 = *D & stk3;
  stk1 = S | stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_206_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%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_206_0_1>:
mov    %esi,%eax
not    %eax
and    %edx,%eax
not    %edx
movzbl (%rdi),%ecx
and    %ecx,%eax
and    %edx,%ecx
or     %esi,%ecx
and    %edx,%ecx
or     %esi,%eax
or     %ecx,%eax
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_206_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = xor i32 %11, -1
%13 = trunc i32 %12 to i8
store i8 %13, i8* %9
%14 = load i8*, i8** %4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = and i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = and i32 %28, %30
%32 = load i8, i8* %7
%33 = zext i8 %32 to i32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = or i32 %31, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = xor i32 %42, -1
%44 = and i32 %40, %43
%45 = load i8*, i8** %4
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = and i32 %44, %47
%49 = or i32 %38, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_206_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = zext i8 %2 to i32
%5 = xor i32 %4, -1
%6 = load i8, i8* %0
%7 = zext i8 %6 to i32
%8 = trunc i32 %5 to i8
%9 = and i8 %6, %8
%10 = zext i8 %1 to i32
%11 = or i8 %9, %1
%12 = zext i8 %11 to i32
%13 = and i32 %12, %5
%14 = xor i32 %10, -1
%15 = and i32 %4, %14
%16 = and i32 %15, %7
%17 = or i32 %16, %10
%18 = or i32 %17, %13
%19 = trunc i32 %18 to i8
store i8 %19, i8* %0
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;
typedef scalar_t__ ui32Base;

/* Variables and functions */
uint32_t PWMGenFaultTriggerGet(uint32_t ui32Base, uint32_t ui32Gen,
                               uint32_t ui32Group) {
  ;
  ;

  ;
  if (ui32Group == 0) {
    return ((*((volatile uint32_t *)(((ui32Base) + (ui32Gen)) + 0x00000034))));
  } else {
    return ((*((volatile uint32_t *)(((ui32Base) + (ui32Gen)) + 0x00000038))));
  }
}


x86 assembly (clang, -O0):
<PWMGenFaultTriggerGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1130 <PWMGenFaultTriggerGet+0x30>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    0x34(%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    1140 <PWMGenFaultTriggerGet+0x40>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    0x38(%rax),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenFaultTriggerGet>:
xor    %eax,%eax
test   %rdx,%rdx
setne  %al
add    %rsi,%rdi
mov    0x34(%rdi,%rax,4),%rax
ret

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

LLVM IR (-O2):
define i64 @PWMGenFaultTriggerGet(i64 %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
%5 = add nsw i64 %1, %0
%6 = select i1 %4, i64 52, i64 56
%7 = add nsw i64 %5, %6
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
ret i64 %9
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void graphics_destroyDisplay() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @graphics_destroyDisplay() {
%1 = tail call i32 (...) @endwin()
ret void
}
/* Variables and functions */
int GetReg(char *);
int GetMOVECreg(void) {
  int reg;
  reg = GetReg("SFC DFC USP VBR");
  switch (reg) {
  case 0:
  case 1:
    break;
  case 2:
    reg = 0x800;
    break;
  case 3:
    reg = 0x801;
    break;
  default:
    break;
  }
  return reg;
}


x86 assembly (clang, -O0):
<GetMOVECreg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <GetReg@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x2,%eax
jb     115d <GetMOVECreg+0x4d>
jmp    113b <GetMOVECreg+0x2b>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
je     1162 <GetMOVECreg+0x52>
jmp    114c <GetMOVECreg+0x3c>
mov    -0x8(%rbp),%eax
sub    $0x3,%eax
je     116e <GetMOVECreg+0x5e>
jmp    117a <GetMOVECreg+0x6a>
jmp    117f <GetMOVECreg+0x6f>
movl   $0x800,-0x4(%rbp)
jmp    117f <GetMOVECreg+0x6f>
movl   $0x801,-0x4(%rbp)
jmp    117f <GetMOVECreg+0x6f>
jmp    117f <GetMOVECreg+0x6f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetMOVECreg>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <GetReg@plt>
cmp    $0x3,%eax
je     112e <GetMOVECreg+0x1e>
cmp    $0x2,%eax
jne    1133 <GetMOVECreg+0x23>
mov    $0x800,%eax
pop    %rcx
ret
mov    $0x801,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"SFC DFC USP VBR\00"
define i32 @GetMOVECreg() {
%1 = alloca i32
%2 = call i32 @GetReg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
store i32 %2, i32* %1
%3 = load i32, i32* %1
switch i32 %3, label %7 [
i32 0, label %4
i32 1, label %4
i32 2, label %5
i32 3, label %6
]
4: ; preds = %0, %0
br label %8
5: ; preds = %0
store i32 2048, i32* %1
br label %8
6: ; preds = %0
store i32 2049, i32* %1
br label %8
7: ; preds = %0
br label %8
8: ; preds = %7, %6, %5, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@.str = [16 x i8] c"SFC DFC USP VBR\00"
define i32 @GetMOVECreg() {
%1 = tail call i32 @GetReg(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
switch i32 %1, label %4 [
i32 3, label %3
i32 2, label %2
]
2: ; preds = %0
br label %4
3: ; preds = %0
br label %4
4: ; preds = %0, %3, %2
%5 = phi i32 [ %1, %0 ], [ 2048, %2 ], [ 2049, %3 ]
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ term_add_bytes(char *, int);
void ecma48_clear_to_eol(void) {
  term_add_bytes("\033[K", (sizeof(""
                                   "\033[K"
                                   "") -
                            1));
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[K\00"
define void @ecma48_clear_to_eol() {
%1 = call i32 @term_add_bytes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[K\00"
define void @ecma48_clear_to_eol() {
%1 = tail call i32 @term_add_bytes(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret void
}
int rgb2bgr(int r, int g, int b) {
  int r2, g2, b2, bgr;
  r2 = (r >> 3) & 0x1f;
  g2 = (g >> 3) & 0x1f;
  b2 = (b >> 3) & 0x1f;
  bgr = (b2 << 10) | (g2 << 5) | r2;
  return bgr;
}


x86 assembly (clang, -O0):
<rgb2bgr>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x3,%eax
and    $0x1f,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0xa,%eax
mov    -0x14(%rbp),%ecx
shl    $0x5,%ecx
or     %ecx,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb2bgr>:
shr    $0x3,%edi
and    $0x1f,%edi
shl    $0x7,%edx
and    $0x7c00,%edx
and    $0xf8,%esi
lea    (%rdi,%rsi,4),%eax
or     %edx,%eax
ret

LLVM IR (-O0):
define i32 @rgb2bgr(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%11 = load i32, i32* %4
%12 = ashr i32 %11, 3
%13 = and i32 %12, 31
store i32 %13, i32* %7
%14 = load i32, i32* %5
%15 = ashr i32 %14, 3
%16 = and i32 %15, 31
store i32 %16, i32* %8
%17 = load i32, i32* %6
%18 = ashr i32 %17, 3
%19 = and i32 %18, 31
store i32 %19, i32* %9
%20 = load i32, i32* %9
%21 = shl i32 %20, 10
%22 = load i32, i32* %8
%23 = shl i32 %22, 5
%24 = or i32 %21, %23
%25 = load i32, i32* %7
%26 = or i32 %24, %25
store i32 %26, i32* %10
%27 = load i32, i32* %10
ret i32 %27
}

LLVM IR (-O2):
define i32 @rgb2bgr(i32 %0, i32 %1, i32 %2) {
%4 = lshr i32 %0, 3
%5 = and i32 %4, 31
%6 = shl i32 %2, 7
%7 = and i32 %6, 31744
%8 = shl i32 %1, 2
%9 = and i32 %8, 992
%10 = or i32 %9, %5
%11 = or i32 %10, %7
ret i32 %11
}
/* Variables and functions */
char *strcpy(char *dest, const char *src) {
  size_t i = 0;
  while (src[i] != '\0') {
    dest[i] = src[i];
    i++;
  }
  dest[i] = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1150 <strcpy+0x50>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%dl
xor    %ecx,%ecx
test   %dl,%dl
je     1120 <strcpy+0x20>
nopl   0x0(%rax,%rax,1)
mov    %dl,(%rax,%rcx,1)
movzbl 0x1(%rsi,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
movb   $0x0,(%rax,%rcx,1)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i64 [ %9, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %6, i8* %8
%9 = add i64 %7, 1
%10 = getelementptr inbounds i8, i8* %1, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i64 [ 0, %2 ], [ %9, %5 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %14
store i8 0, i8* %15
ret i8* %0
}
int __attribute__((visibility("default"))) func_from_executable(void) {
  return 42;
}


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

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

LLVM IR (-O0):
define i32 @func_from_executable() {
ret i32 42
}

LLVM IR (-O2):
define i32 @func_from_executable() {
ret i32 42
}
/* Variables and functions */
char const *getenv(char *);
const char *get_extractors_dir() {
  return getenv("EXTRACTORS_DIR") ? getenv("EXTRACTORS_DIR")
                                  : "/usr/lib/extractor-mini";
}


x86 assembly (clang, -O0):
<get_extractors_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
cmp    $0x0,%rax
je     1143 <get_extractors_dir+0x33>
lea    0xecb(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
jmp    1153 <get_extractors_dir+0x43>
lea    0xec5(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1153 <get_extractors_dir+0x43>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_extractors_dir>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
lea    0xee8(%rip),%rcx
cmove  %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"EXTRACTORS_DIR\00"
@.str.1 = [24 x i8] c"/usr/lib/extractor-mini\00"
define i8* @get_extractors_dir() {
%1 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i8* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %6
5: ; preds = %0
br label %6
6: ; preds = %5, %3
%7 = phi i8* [ %4, %3 ], [ getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), %5 ]
ret i8* %7
}

LLVM IR (-O2):
@.str = [15 x i8] c"EXTRACTORS_DIR\00"
@.str.1 = [24 x i8] c"/usr/lib/extractor-mini\00"
define i8* @get_extractors_dir() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i8* %1, null
%3 = select i1 %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i8* %1
ret i8* %3
}
int nibble_from_hex(int ascii) {
  if (ascii >= '0' && ascii <= '9')
    return ascii & 0x0F;
  if (ascii >= 'A' && ascii <= 'F')
    return (ascii - 7) & 0x0F;
  return -1;
}


x86 assembly (clang, -O0):
<nibble_from_hex>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1129 <nibble_from_hex+0x29>
cmpl   $0x39,-0x8(%rbp)
jg     1129 <nibble_from_hex+0x29>
mov    -0x8(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <nibble_from_hex+0x55>
cmpl   $0x41,-0x8(%rbp)
jl     114e <nibble_from_hex+0x4e>
cmpl   $0x46,-0x8(%rbp)
jg     114e <nibble_from_hex+0x4e>
mov    -0x8(%rbp),%eax
sub    $0x7,%eax
and    $0xf,%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <nibble_from_hex+0x55>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nibble_from_hex>:
lea    -0x30(%rdi),%eax
cmp    $0x9,%eax
jbe    1118 <nibble_from_hex+0x18>
lea    -0x41(%rdi),%ecx
mov    $0xffffffff,%eax
cmp    $0x5,%ecx
ja     111d <nibble_from_hex+0x1d>
add    $0x9,%edi
and    $0xf,%edi
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @nibble_from_hex(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 57
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %3
%11 = and i32 %10, 15
store i32 %11, i32* %2
br label %23
12: ; preds = %6, %1
%13 = load i32, i32* %3
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %22
15: ; preds = %12
%16 = load i32, i32* %3
%17 = icmp sle i32 %16, 70
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %3
%20 = sub nsw i32 %19, 7
%21 = and i32 %20, 15
store i32 %21, i32* %2
br label %23
22: ; preds = %15, %12
store i32 -1, i32* %2
br label %23
23: ; preds = %22, %18, %9
%24 = load i32, i32* %2
ret i32 %24
}

LLVM IR (-O2):
define i32 @nibble_from_hex(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = and i32 %0, 15
br label %12
6: ; preds = %1
%7 = add i32 %0, -65
%8 = icmp ult i32 %7, 6
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = add nuw nsw i32 %0, 9
%11 = and i32 %10, 15
br label %12
12: ; preds = %6, %9, %4
%13 = phi i32 [ %5, %4 ], [ %11, %9 ], [ -1, %6 ]
ret i32 %13
}