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

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int shittydb_set(const char *key, const char *val) {
  FILE *file = fopen(key, "w");
  if (!file)
    return 1;
  fprintf(file, "%s", val);
  fclose(file);
  return 0;
}


x86 assembly (clang, -O0):
<shittydb_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116b <shittydb_set+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    118f <shittydb_set+0x5f>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe88(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shittydb_set>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
lea    0xec2(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1162 <shittydb_set+0x32>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rax,%rsi
call   1040 <fputs@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
jmp    1167 <shittydb_set+0x37>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
define i32 @shittydb_set(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @fputs(i8* %1, i32* %3)
%7 = tail call i32 @fclose(i32* %3)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %9
}
$ENDP() { exit(0); }


x86 assembly (clang, -O0):
<$ENDP>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<$ENDP>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define i32 @"$ENDP"() {
unreachable
}

LLVM IR (-O2):
define i32 @"$ENDP"() {
tail call void @exit(i32 0)
unreachable
}
int test_imm_33uint32_mem(unsigned int *val) {
  return ((*val) & (0x33 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_33uint32_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
and    $0x33,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_33uint32_mem>:
testb  $0x33,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_33uint32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 51
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_33uint32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 51
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct timespec {
  unsigned int tv_sec;
  scalar_t__ tv_nsec;
};

/* Variables and functions */
int nanosleep(struct timespec *, struct timespec *);
unsigned int sleep(unsigned int seconds) {
  struct timespec requested;
  struct timespec remaining;
  requested.tv_sec = seconds;
  requested.tv_nsec = 0;
  int result = nanosleep(&requested, &remaining);
  if (result < 0) {
    return remaining.tv_sec;
  }
  return 0;
}


x86 assembly (clang, -O0):
<sleep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <nanosleep@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jge    114e <sleep+0x3e>
mov    -0x28(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1155 <sleep+0x45>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sleep>:
sub    $0x28,%rsp
mov    %edi,0x8(%rsp)
movq   $0x0,0x10(%rsp)
lea    0x8(%rsp),%rdi
lea    0x18(%rsp),%rsi
call   1030 <nanosleep@plt>
sar    $0x1f,%eax
and    0x18(%rsp),%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i32 @sleep(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.timespec
%5 = alloca %struct.timespec
%6 = alloca i32
store i32 %0, i32* %3
%7 = load i32, i32* %3
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 0
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 1
store i64 0, i64* %9
%10 = call i32 @nanosleep(%struct.timespec* %4, %struct.timespec* %5)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%15 = load i32, i32* %14
store i32 %15, i32* %2
br label %17
16: ; preds = %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %13
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i32 @sleep(i32 %0) {
%2 = alloca %struct.timespec
%3 = alloca %struct.timespec
%4 = bitcast %struct.timespec* %2 to i8*
%5 = bitcast %struct.timespec* %3 to i8*
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i32 %0, i32* %6
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 0, i64* %7
%8 = call i32 @nanosleep(%struct.timespec* %2, %struct.timespec* %3)
%9 = icmp slt i32 %8, 0
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i64 0, i32 0
%11 = load i32, i32* %10
%12 = select i1 %9, i32 %11, i32 0
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ stderr;
int strlen(char *);
char *clone2strings(char *s1, char *s2) {
  char *res;
  res = (char *)malloc((strlen(s1) + strlen(s2) + 1) * sizeof(char));
  sprintf(res, "%s%s", s1, s2);
  if (0)
    fprintf(stderr, "clone2strings(%s, %s) = %s\n", s1, s2, res);
  return res;
}


x86 assembly (clang, -O0):
<clone2strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe7d(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clone2strings>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1030 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xe9c(%rip),%rsi
mov    %rax,%rdi
mov    %r12,%rdx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
@stderr = global i32 0
define i8* @clone2strings(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = add nsw i32 %7, %9
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 1
%14 = trunc i64 %13 to i32
%15 = call i64 @malloc(i32 %14)
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %5
%17 = load i8*, i8** %5
%18 = load i8*, i8** %3
%19 = load i8*, i8** %4
%20 = call i32 @sprintf(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %18, i8* %19)
%21 = load i8*, i8** %5
ret i8* %21
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@stderr = global i32 0
define i8* @clone2strings(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @sprintf(i8* dereferenceable(1) %8, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ renameSymbol();
int main() {
  int x = 1;
  renameSymbol();
  printf("x == %d\n", x);
  ;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <renameSymbol@plt>
lea    0xed1(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"x == %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @renameSymbol()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
int _isatty(int fildes) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @_isatty(i32 %0) {
ret i32 1
}
void ASN1_pack_string(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_pack_string() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void *realloc(void *, int);
void *xrealloc(void *oldmem, int size) {
  void *mem;
  if (size < 1) {
    size = 1;
  }
  mem = realloc(oldmem, size);
  if (mem == NULL) {
    perror("xrealloc");
  }
  return mem;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jge    1140 <xrealloc+0x20>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1167 <xrealloc+0x47>
lea    0xe9e(%rip),%rdi
call   1040 <perror@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
test   %esi,%esi
mov    $0x1,%eax
cmovle %eax,%esi
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113d <xrealloc+0x1d>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xebc(%rip),%rdi
call   1040 <perror@plt>
jmp    1138 <xrealloc+0x18>

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

LLVM IR (-O2):
@.str = [9 x i8] c"xrealloc\00"
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
%4 = select i1 %3, i32 %1, i32 1
%5 = tail call i8* @realloc(i8* %0, i32 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @perror(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
ret i8* %5
}
int RR_comparator(const void *thing1, const void *thing2) { return -1; }


x86 assembly (clang, -O0):
<RR_comparator>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @RR_comparator(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
void gdk_prop_mode_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_prop_mode_get_type() {
ret void
}
int pm_sleep_lock(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @pm_sleep_lock() {
ret i32 0
}
int main() {
  char Array[20] = {"Miss Dong"};
  printf("%s", my_strnchr(Array, 's', 2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x73,%esi
mov    $0x2,%edx
mov    $0x0,%al
call   1040 <my_strnchr@plt>
mov    %eax,%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xed5(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x10(%rsp)
mov    %rsp,%rdi
mov    $0x73,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <my_strnchr@plt>
lea    0xec2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.Array = [20 x i8] c"Miss Dong\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @my_strnchr to i32 (i8*, i32, i32, ...)*)(i8* %2, i32 115, i32 2)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
scalar_t__ ScreenMarker();
int ScreenAllMarker() {
  static char RoutineName[] = "ScreenAllMarker";
  if (ScreenMarker() < 0) {
    return (-1);
  }
  while (ScreenMarker() >= 0)
    ;
  return (0);
}


x86 assembly (clang, -O0):
<ScreenAllMarker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <ScreenMarker@plt>
cmp    $0x0,%rax
jge    1135 <ScreenAllMarker+0x25>
movl   $0xffffffff,-0x4(%rbp)
jmp    1157 <ScreenAllMarker+0x47>
jmp    113a <ScreenAllMarker+0x2a>
mov    $0x0,%al
call   1030 <ScreenMarker@plt>
cmp    $0x0,%rax
jl     1150 <ScreenAllMarker+0x40>
jmp    113a <ScreenAllMarker+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScreenAllMarker>:
push   %rbx
xor    %eax,%eax
call   1030 <ScreenMarker@plt>
test   %rax,%rax
js     112e <ScreenAllMarker+0x1e>
xor    %ebx,%ebx
nop
xor    %eax,%eax
call   1030 <ScreenMarker@plt>
test   %rax,%rax
jns    1120 <ScreenAllMarker+0x10>
jmp    1133 <ScreenAllMarker+0x23>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@ScreenAllMarker.RoutineName = internal global [16 x i8] c"ScreenAllMarker\00"
define i32 @ScreenAllMarker() {
%1 = alloca i32
%2 = call i64 (...) @ScreenMarker()
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %0
store i32 -1, i32* %1
br label %11
5: ; preds = %0
br label %6
6: ; preds = %9, %5
%7 = call i64 (...) @ScreenMarker()
%8 = icmp sge i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
br label %6
10: ; preds = %6
store i32 0, i32* %1
br label %11
11: ; preds = %10, %4
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @ScreenAllMarker() {
%1 = tail call i64 (...) @ScreenMarker()
%2 = icmp slt i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0, %3
%4 = tail call i64 (...) @ScreenMarker()
%5 = icmp sgt i64 %4, -1
br i1 %5, label %3, label %6
6: ; preds = %3, %0
%7 = phi i32 [ -1, %0 ], [ 0, %3 ]
ret i32 %7
}
/* Variables and functions */
unsigned char toupper(unsigned char);
char *strupr(char *str) {
  unsigned char *p = (unsigned char *)str;
  while (*p) {
    *p = toupper((unsigned char)*p);
    p++;
  }
  return str;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1156 <strupr+0x46>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <strupr+0x14>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%al
test   %al,%al
je     1146 <strupr+0x36>
lea    0x1(%r14),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call zeroext i8 @toupper(i8 zeroext %5)
store i8 %7, i8* %6
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
int sysfs_remove_bin_file(struct kobject *k, struct bin_attribute *a) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.bin_attribute = type opaque
define i32 @sysfs_remove_bin_file(%struct.kobject* nocapture readnone %0, %struct.bin_attribute* nocapture readnone %1) {
ret i32 0
}
int test_imm_25uint16_mem(unsigned short *val) {
  return ((*val) & (-0x25 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_25uint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xffffffdb,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_25uint16_mem>:
movzwl (%rdi),%eax
test   $0xffdb,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_25uint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = and i32 %5, -37
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 -20, i32 -40
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_imm_25uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -37
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
signed char d_getsb(register const unsigned char *ptr) { return ptr[0]; }


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

x86 assembly (clang, -O2):
<d_getsb>:
mov    (%rdi),%al
ret

LLVM IR (-O0):
define signext i8 @d_getsb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @d_getsb(i8* nocapture %0) {
%2 = load i8, i8* %0
ret i8 %2
}
void mpi_set_arrays_perpoint_perline(void) {}


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

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

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

LLVM IR (-O2):
define void @mpi_set_arrays_perpoint_perline() {
ret void
}
/* Variables and functions */
int getch();
int /*<<< orphan*/ puts0(char *);
void pause(void) {
  int c;
  puts0(" Pause. Press any key ");
  c = getch();
}


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1040 <puts0@plt>
mov    $0x0,%al
call   1030 <getch@plt>
mov    %eax,-0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <puts0@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <getch@plt>

LLVM IR (-O0):
@.str = [23 x i8] c" Pause. Press any key \00"
define void @pause() {
%1 = alloca i32
%2 = call i32 @puts0(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @getch()
store i32 %3, i32* %1
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c" Pause. Press any key \00"
define void @pause() {
%1 = tail call i32 @puts0(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @getch()
ret void
}
unsigned long get_wchan(struct task_struct *p) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.task_struct = type opaque
define i64 @get_wchan(%struct.task_struct* nocapture readnone %0) {
ret i64 0
}
extern unsigned int hweight32(unsigned int w) {
  w = (w & 0x55555555) + ((w >> 1) & 0x55555555);
  w = (w & 0x33333333) + ((w >> 2) & 0x33333333);
  w = (w & 0x0F0F0F0F) + ((w >> 4) & 0x0F0F0F0F);
  w = (w & 0x00FF00FF) + ((w >> 8) & 0x00FF00FF);
  w = (w & 0x0000FFFF) + ((w >> 16) & 0x0000FFFF);
  return w;
}


x86 assembly (clang, -O0):
<hweight32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x55555555,%eax
mov    -0x4(%rbp),%ecx
shr    $0x1,%ecx
and    $0x55555555,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x33333333,%eax
mov    -0x4(%rbp),%ecx
shr    $0x2,%ecx
and    $0x33333333,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf0f0f0f,%eax
mov    -0x4(%rbp),%ecx
shr    $0x4,%ecx
and    $0xf0f0f0f,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff00ff,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff00ff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
and    $0xffff,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hweight32>:
mov    %edi,%eax
and    $0x55555555,%eax
shr    %edi
and    $0x55555555,%edi
add    %edi,%eax
mov    %eax,%ecx
and    $0x33333333,%ecx
shr    $0x2,%eax
and    $0x33333333,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0x7070707,%ecx
shr    $0x4,%eax
and    $0x7070707,%eax
add    %ecx,%eax
mov    %eax,%ecx
and    $0xf000f,%ecx
shr    $0x8,%eax
and    $0xf000f,%eax
add    %ecx,%eax
movzwl %ax,%ecx
shr    $0x10,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @hweight32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 1431655765
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
%7 = and i32 %6, 1431655765
%8 = add i32 %4, %7
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = and i32 %9, 858993459
%11 = load i32, i32* %2
%12 = lshr i32 %11, 2
%13 = and i32 %12, 858993459
%14 = add i32 %10, %13
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = and i32 %15, 252645135
%17 = load i32, i32* %2
%18 = lshr i32 %17, 4
%19 = and i32 %18, 252645135
%20 = add i32 %16, %19
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = and i32 %21, 16711935
%23 = load i32, i32* %2
%24 = lshr i32 %23, 8
%25 = and i32 %24, 16711935
%26 = add i32 %22, %25
store i32 %26, i32* %2
%27 = load i32, i32* %2
%28 = and i32 %27, 65535
%29 = load i32, i32* %2
%30 = lshr i32 %29, 16
%31 = and i32 %30, 65535
%32 = add i32 %28, %31
store i32 %32, i32* %2
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @hweight32(i32 %0) {
%2 = and i32 %0, 1431655765
%3 = lshr i32 %0, 1
%4 = and i32 %3, 1431655765
%5 = add nuw i32 %4, %2
%6 = and i32 %5, 858993459
%7 = lshr i32 %5, 2
%8 = and i32 %7, 858993459
%9 = add nuw nsw i32 %8, %6
%10 = and i32 %9, 117901063
%11 = lshr i32 %9, 4
%12 = and i32 %11, 117901063
%13 = add nuw nsw i32 %12, %10
%14 = and i32 %13, 983055
%15 = lshr i32 %13, 8
%16 = and i32 %15, 983055
%17 = add nuw nsw i32 %16, %14
%18 = and i32 %17, 31
%19 = lshr i32 %17, 16
%20 = add nuw nsw i32 %18, %19
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ ArgText();
int /*<<< orphan*/ Me();
int /*<<< orphan*/ SendItem(int /*<<< orphan*/, char *, int /*<<< orphan*/);
int /*<<< orphan*/ TextOf(int /*<<< orphan*/);
void Act_Msg(void) { SendItem(Me(), "%s", TextOf(ArgText())); }


x86 assembly (clang, -O0):
<Act_Msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <Me@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%edx
lea    0xe94(%rip),%rsi
call   1040 <SendItem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Act_Msg>:
push   %rbx
xor    %eax,%eax
call   1050 <Me@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <ArgText@plt>
mov    %eax,%edi
call   1060 <TextOf@plt>
lea    0xea1(%rip),%rsi
mov    %ebx,%edi
mov    %eax,%edx
pop    %rbx
jmp    1040 <SendItem@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @Act_Msg() {
%1 = call i32 (...) @Me()
%2 = call i32 (...) @ArgText()
%3 = call i32 @TextOf(i32 %2)
%4 = call i32 @SendItem(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @Act_Msg() {
%1 = tail call i32 (...) @Me()
%2 = tail call i32 (...) @ArgText()
%3 = tail call i32 @TextOf(i32 %2)
%4 = tail call i32 @SendItem(i32 %1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int rand();
int randIntBorned(int a, int b) {
  if (a == b) {
    return a;
  }
  return rand() % (b - a) + a;
}


x86 assembly (clang, -O0):
<randIntBorned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1135 <randIntBorned+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114b <randIntBorned+0x3b>
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0xc(%rbp),%ecx
sub    -0x8(%rbp),%ecx
cltd
idiv   %ecx
add    -0x8(%rbp),%edx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randIntBorned>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%eax
mov    %esi,%ebp
sub    %edi,%ebp
je     112b <randIntBorned+0x1b>
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
mov    %edx,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @randIntBorned(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp eq i32 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load i32, i32* %4
store i32 %10, i32* %3
br label %19
11: ; preds = %2
%12 = call i32 (...) @rand()
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = sub nsw i32 %13, %14
%16 = srem i32 %12, %15
%17 = load i32, i32* %4
%18 = add nsw i32 %16, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %11, %9
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @randIntBorned(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, %0
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = tail call i32 (...) @rand()
%6 = sub nsw i32 %1, %0
%7 = srem i32 %5, %6
%8 = add nsw i32 %7, %0
br label %9
9: ; preds = %2, %4
%10 = phi i32 [ %8, %4 ], [ %1, %2 ]
ret i32 %10
}
int conf_load_file(struct conf *conf, int fd) { return 0; }


x86 assembly (clang, -O0):
<conf_load_file>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
%struct.conf = type opaque
define i32 @conf_load_file(%struct.conf* nocapture readnone %0, i32 %1) {
ret i32 0
}
int config_handler(void *user, const char *section, const char *name,
                   const char *value) {
  return 1;
}


x86 assembly (clang, -O0):
<config_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @config_handler(i8* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
ret i32 1
}

LLVM IR (-O2):
define i32 @config_handler(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
char *hola() { printf("%s\n", "Hola Mundo"); }


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

x86 assembly (clang, -O2):
<hola>:
lea    0xee9(%rip),%rdi
lea    0xee6(%rip),%rsi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [11 x i8] c"Hola Mundo\00"
define noalias i8* @hola() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i8* undef
}
/* Type definitions */
struct cli_def {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cli_print(struct cli_def *, char *, char const *);
int request_cb(struct cli_def *cli, const char *response) {
  cli_print(cli, "You entered: %s", response);
  return 0;
}


x86 assembly (clang, -O0):
<request_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <cli_print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<request_cb>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <cli_print@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.cli_def = type { i32 }
@.str = [16 x i8] c"You entered: %s\00"
define i32 @request_cb(%struct.cli_def* %0, i8* %1) {
%3 = alloca %struct.cli_def*
%4 = alloca i8*
store %struct.cli_def* %0, %struct.cli_def** %3
store i8* %1, i8** %4
%5 = load %struct.cli_def*, %struct.cli_def** %3
%6 = load i8*, i8** %4
%7 = call i32 @cli_print(%struct.cli_def* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %6)
ret i32 0
}

LLVM IR (-O2):
%struct.cli_def = type { i32 }
@.str = [16 x i8] c"You entered: %s\00"
define i32 @request_cb(%struct.cli_def* %0, i8* %1) {
%3 = tail call i32 @cli_print(%struct.cli_def* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ set_node_field_value_c(int *, int *, double *);
void set_node_field_value(int row, int col, double value) {
  set_node_field_value_c(&row, &col, &value);
}


x86 assembly (clang, -O0):
<set_node_field_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1030 <set_node_field_value_c@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_node_field_value>:
sub    $0x18,%rsp
mov    %edi,0xc(%rsp)
mov    %esi,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%rdx
call   1030 <set_node_field_value_c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @set_node_field_value(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = call i32 @set_node_field_value_c(i32* %4, i32* %5, double* %6)
ret void
}

LLVM IR (-O2):
define void @set_node_field_value(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%7 = call i32 @set_node_field_value_c(i32* %4, i32* %5, double* %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: build [Kernel ELF] [Output file]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [41 x i8] c"Usage: build [Kernel ELF] [Output file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [41 x i8] c"Usage: build [Kernel ELF] [Output file]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
void glmRadians3f_(float degrees[3]) {
  for (size_t i = 0; i < 3; ++i)
    degrees[i] *= (3.14159265358979323846 / 180);
}


x86 assembly (clang, -O0):
<glmRadians3f_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x3,-0x10(%rbp)
jae    1152 <glmRadians3f_+0x52>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecc(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <glmRadians3f_+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmRadians3f_>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
cvtss2sd %xmm0,%xmm0
movsd  0xeeb(%rip),%xmm2
mulsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
mulsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
movss  %xmm0,(%rdi)
movss  %xmm1,0x4(%rdi)
movss  0x8(%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @glmRadians3f_(float* %0) {
%2 = alloca float*
%3 = alloca i64
store float* %0, float** %2
store i64 0, i64* %3
br label %4
4: ; preds = %15, %1
%5 = load i64, i64* %3
%6 = icmp ult i64 %5, 3
br i1 %6, label %7, label %18
7: ; preds = %4
%8 = load float*, float** %2
%9 = load i64, i64* %3
%10 = getelementptr inbounds float, float* %8, i64 %9
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = fmul double %12, 0x3F91DF46A2529D39
%14 = fptrunc double %13 to float
store float %14, float* %10
br label %15
15: ; preds = %7
%16 = load i64, i64* %3
%17 = add i64 %16, 1
store i64 %17, i64* %3
br label %4
18: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @glmRadians3f_(float* nocapture %0) {
%2 = load float, float* %0
%3 = fpext float %2 to double
%4 = fmul double %3, 0x3F91DF46A2529D39
%5 = fptrunc double %4 to float
store float %5, float* %0
%6 = getelementptr inbounds float, float* %0, i64 1
%7 = load float, float* %6
%8 = fpext float %7 to double
%9 = fmul double %8, 0x3F91DF46A2529D39
%10 = fptrunc double %9 to float
store float %10, float* %6
%11 = getelementptr inbounds float, float* %0, i64 2
%12 = load float, float* %11
%13 = fpext float %12 to double
%14 = fmul double %13, 0x3F91DF46A2529D39
%15 = fptrunc double %14 to float
store float %15, float* %11
ret void
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
double now() {
  struct timeval tp;
  if (gettimeofday(&tp, NULL) < 0) {
    perror("gettimeofday failed");
  }
  return (double)tp.tv_sec + (double)tp.tv_usec * 1.e-6;
}


x86 assembly (clang, -O0):
<now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jge    114b <now+0x2b>
lea    0xec2(%rip),%rdi
call   1040 <perror@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xea1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
js     1154 <now+0x34>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xeb5(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
jmp    1135 <now+0x15>

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [20 x i8] c"gettimeofday failed\00"
define double @now() {
%1 = alloca %struct.timeval
%2 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = icmp slt i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = call double @llvm.fmuladd.f64(double %12, double 0x3EB0C6F7A0B5ED8D, double %9)
ret double %13
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [20 x i8] c"gettimeofday failed\00"
define double @now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp slt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %0
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = sitofp i64 %9 to double
%11 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%12 = load i64, i64* %11
%13 = sitofp i64 %12 to double
%14 = tail call double @llvm.fmuladd.f64(double %13, double 0x3EB0C6F7A0B5ED8D, double %10)
ret double %14
}
/* Type definitions */
struct passwd {
  char *pw_name;
};

/* Variables and functions */
char *dss_strdup(char *);
struct passwd *getpwuid(int /*<<< orphan*/);
int /*<<< orphan*/ getuid();
__attribute__((warn_unused_result)) __attribute__((malloc)) char *
dss_logname(void) {
  struct passwd *pw = getpwuid(getuid());
  return dss_strdup(pw ? pw->pw_name : "unknown_user");
}


x86 assembly (clang, -O0):
<dss_logname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1165 <dss_logname+0x35>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    1175 <dss_logname+0x45>
lea    0xe94(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    1175 <dss_logname+0x45>
mov    -0x10(%rbp),%rdi
call   1050 <dss_strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dss_logname>:
push   %rax
xor    %eax,%eax
call   1040 <getuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
test   %rax,%rax
je     114d <dss_logname+0x1d>
mov    (%rax),%rdi
pop    %rax
jmp    1050 <dss_strdup@plt>
lea    0xeac(%rip),%rdi
pop    %rax
jmp    1050 <dss_strdup@plt>

LLVM IR (-O0):
%struct.passwd = type { i8* }
@.str = [13 x i8] c"unknown_user\00"
define noalias i8* @dss_logname() {
%1 = alloca %struct.passwd*
%2 = call i32 (...) @getuid()
%3 = call %struct.passwd* @getpwuid(i32 %2)
store %struct.passwd* %3, %struct.passwd** %1
%4 = load %struct.passwd*, %struct.passwd** %1
%5 = icmp ne %struct.passwd* %4, null
br i1 %5, label %6, label %10
6: ; preds = %0
%7 = load %struct.passwd*, %struct.passwd** %1
%8 = getelementptr inbounds %struct.passwd, %struct.passwd* %7, i32 0, i32 0
%9 = load i8*, i8** %8
br label %11
10: ; preds = %0
br label %11
11: ; preds = %10, %6
%12 = phi i8* [ %9, %6 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %10 ]
%13 = call i8* @dss_strdup(i8* %12)
ret i8* %13
}

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [13 x i8] c"unknown_user\00"
define noalias i8* @dss_logname() {
%1 = tail call i32 (...) @getuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %0
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %0, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), %0 ]
%9 = tail call i8* @dss_strdup(i8* %8)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ PIN_IRQ_Handler(int);
void PIN_INT7_IRQHandler(void) { PIN_IRQ_Handler(7); }


x86 assembly (clang, -O0):
<PIN_INT7_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
mov    $0x7,%edi
call   1030 <PIN_IRQ_Handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<PIN_INT7_IRQHandler>:
mov    $0x7,%edi
jmp    1030 <PIN_IRQ_Handler@plt>

LLVM IR (-O0):
define void @PIN_INT7_IRQHandler() {
%1 = call i32 @PIN_IRQ_Handler(i32 7)
ret void
}

LLVM IR (-O2):
define void @PIN_INT7_IRQHandler() {
%1 = tail call i32 @PIN_IRQ_Handler(i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ display(int *);
int /*<<< orphan*/ eliminate(int *);
int /*<<< orphan*/ fill_array(int *);
int /*<<< orphan*/ free(int *);
int *malloc(int);
int main() {
  int *arr = malloc(sizeof(int) * 100);
  fill_array(arr);
  eliminate(arr);
  display(arr);
  free(arr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x190,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <fill_array@plt>
mov    -0x10(%rbp),%rdi
call   1040 <eliminate@plt>
mov    -0x10(%rbp),%rdi
call   1050 <display@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x190,%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <fill_array@plt>
mov    %rbx,%rdi
call   1040 <eliminate@plt>
mov    %rbx,%rdi
call   1050 <display@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i32* @malloc(i32 400)
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fill_array(i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @eliminate(i32* %6)
%8 = load i32*, i32** %2
%9 = call i32 @display(i32* %8)
%10 = load i32*, i32** %2
%11 = call i32 @free(i32* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32* @malloc(i32 400)
%2 = tail call i32 @fill_array(i32* %1)
%3 = tail call i32 @eliminate(i32* %1)
%4 = tail call i32 @display(i32* %1)
%5 = tail call i32 @free(i32* %1)
ret i32 0
}