xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_config_parse_size() {
  printf("NOT IMPLEMENTED:"
         "pa_config_parse_size"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [38 x i8] c"NOT IMPLEMENTED:pa_config_parse_size\0A\00"
define i32 @pa_config_parse_size() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [37 x i8] c"NOT IMPLEMENTED:pa_config_parse_size\00"
define i32 @pa_config_parse_size() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void foo40() {}


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

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

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

LLVM IR (-O2):
define void @foo40() {
ret void
}
/* Type definitions */
struct sembuf {
  int dummy;
};

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int semop(int, struct sembuf *, unsigned int);
int solidsemop(int __semid, struct sembuf *__sops, unsigned __nsops) {
  int err;
  while ((err = semop(__semid, __sops, __nsops)) == -1 && errno == EINTR) {
  }
  return (err);
}


x86 assembly (clang, -O0):
<solidsemop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <semop@plt>
mov    %eax,%ecx
mov    %ecx,-0x18(%rbp)
xor    %eax,%eax
cmp    $0xffffffff,%ecx
mov    %al,-0x19(%rbp)
jne    115e <solidsemop+0x4e>
mov    0x2e95(%rip),%rax
mov    (%rax),%rax
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    116e <solidsemop+0x5e>
jmp    1173 <solidsemop+0x63>
jmp    1122 <solidsemop+0x12>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solidsemop>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %edi,%ebp
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <semop@plt>
cmp    $0xffffffff,%eax
jne    114b <solidsemop+0x3b>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <solidsemop+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sembuf = type { i32 }
@errno = global i64 0
@EINTR = global i64 0
define i32 @solidsemop(i32 %0, %struct.sembuf* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sembuf*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sembuf* %1, %struct.sembuf** %5
store i32 %2, i32* %6
br label %8
8: ; preds = %20, %3
%9 = load i32, i32* %4
%10 = load %struct.sembuf*, %struct.sembuf** %5
%11 = load i32, i32* %6
%12 = call i32 @semop(i32 %9, %struct.sembuf* %10, i32 %11)
store i32 %12, i32* %7
%13 = icmp eq i32 %12, -1
br i1 %13, label %14, label %18
14: ; preds = %8
%15 = load i64, i64* @errno
%16 = load i64, i64* @EINTR
%17 = icmp eq i64 %15, %16
br label %18
18: ; preds = %14, %8
%19 = phi i1 [ false, %8 ], [ %17, %14 ]
br i1 %19, label %20, label %21
20: ; preds = %18
br label %8
21: ; preds = %18
%22 = load i32, i32* %7
ret i32 %22
}

LLVM IR (-O2):
%struct.sembuf = type { i32 }
@errno = global i64 0
@EINTR = global i64 0
define i32 @solidsemop(i32 %0, %struct.sembuf* %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @semop(i32 %0, %struct.sembuf* %1, i32 %2)
%6 = icmp eq i32 %5, -1
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *, int);
int /*<<< orphan*/ print_type(char *, int);
void gen_int32() {
  if (sizeof(int) == 4)
    print_type("int", 32);
  else if (sizeof(long) == 4)
    print_type("long", 32);
  else
    print_error("long", sizeof(long));
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"int\00"
define void @gen_int32() {
%1 = call i32 @print_type(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 32)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"int\00"
define void @gen_int32() {
%1 = tail call i32 @print_type(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __stack_chk_fail();
__attribute__((noreturn)) void __stack_chk_fail_local(void) {
  __stack_chk_fail();
}


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

x86 assembly (clang, -O2):
<__stack_chk_fail_local>:
push   %rax
xor    %eax,%eax
call   1030 <__stack_chk_fail@plt>

LLVM IR (-O0):
define void @__stack_chk_fail_local() {
%1 = call i32 (...) @__stack_chk_fail()
unreachable
}

LLVM IR (-O2):
define void @__stack_chk_fail_local() {
%1 = tail call i32 (...) @__stack_chk_fail()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x1e() {
  Assert_real((isupper(30) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isupper.c",
              155, ("isupper should be 0 for 0x1e"));
}


x86 assembly (clang, -O0):
<t_isupper_0x1e>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x9b,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x1e>:
push   %rax
mov    $0x1e,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x9b,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x1e\00"
define void @t_isupper_0x1e() {
%1 = call i64 @isupper(i32 30)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 155, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x1e\00"
define void @t_isupper_0x1e() {
%1 = tail call i64 @isupper(i32 30)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 155, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void board_endcmdread(void) {}


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

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

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

LLVM IR (-O2):
define void @board_endcmdread() {
ret void
}
int bar(int x, char y) {
  { return (x + (int)y); }
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%eax
movsbl -0x5(%rbp),%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
lea    (%rdi,%rsi,1),%eax
ret

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

LLVM IR (-O2):
define i32 @bar(i32 %0, i8 signext %1) {
%3 = sext i8 %1 to i32
%4 = add nsw i32 %3, %0
ret i32 %4
}
void gtk_text_view_get_window_type() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_view_get_window_type() {
ret void
}
void upperCase(char *theChar) {
  if (*theChar >= 'a' && *theChar <= 'z') {
    (*theChar) += ('A' - 'a');
  }
}


x86 assembly (clang, -O0):
<upperCase>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     1134 <upperCase+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     1134 <upperCase+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    $0xffffffe0,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<upperCase>:
mov    (%rdi),%al
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
ja     110e <upperCase+0xe>
add    $0xe0,%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
define void @upperCase(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %18
7: ; preds = %1
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 122
br i1 %11, label %12, label %18
12: ; preds = %7
%13 = load i8*, i8** %2
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = add nsw i32 %15, -32
%17 = trunc i32 %16 to i8
store i8 %17, i8* %13
br label %18
18: ; preds = %12, %7, %1
ret void
}

LLVM IR (-O2):
define void @upperCase(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -97
%4 = icmp ult i8 %3, 26
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = add nsw i8 %2, -32
store i8 %6, i8* %0
br label %7
7: ; preds = %5, %1
ret void
}
int do_signal(int *regs, int *oldset) { return *regs + *oldset; }


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

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

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

LLVM IR (-O2):
define i32 @do_signal(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Type definitions */
struct passwd {
  char const *pw_name;
};

/* Variables and functions */
struct passwd *getpwuid(int);
const char *getUserName(int uid) {
  struct passwd *pw = getpwuid(uid);
  if (pw) {
    return pw->pw_name;
  }
  return "";
}


x86 assembly (clang, -O0):
<getUserName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <getpwuid@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1142 <getUserName+0x32>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    114d <getUserName+0x3d>
lea    0xeb7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getUserName>:
push   %rax
call   1030 <getpwuid@plt>
test   %rax,%rax
je     1120 <getUserName+0x10>
mov    (%rax),%rax
pop    %rcx
ret
lea    0xed9(%rip),%rax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.passwd = type { i8* }
@.str = [1 x i8] zeroinitializer
define i8* @getUserName(i32 %0) {
%2 = tail call %struct.passwd* @getpwuid(i32 %0)
%3 = icmp eq %struct.passwd* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds %struct.passwd, %struct.passwd* %2, i64 0, i32 0
%6 = load i8*, i8** %5
br label %7
7: ; preds = %1, %4
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %1 ]
ret i8* %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_conf(void *rc) { free(rc); }


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

x86 assembly (clang, -O2):
<free_conf>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_conf(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
double pow(int, double);
double pow2(double x) { return pow(2, x); }


x86 assembly (clang, -O0):
<pow2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow2>:
mov    $0x2,%edi
jmp    1030 <pow@plt>

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

LLVM IR (-O2):
define double @pow2(double %0) {
%2 = tail call double @pow(i32 2, double %0)
ret double %2
}
int mul8bit(int a, int b) {
  int t = a * b + 128;
  return ((t + (t >> 8)) >> 8);
}


x86 assembly (clang, -O0):
<mul8bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
add    $0x80,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0x8,%ecx
add    %ecx,%eax
sar    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul8bit>:
imul   %esi,%edi
lea    0x80(%rdi),%eax
sar    $0x8,%eax
add    %edi,%eax
add    $0x80,%eax
sar    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @mul8bit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
%9 = add nsw i32 %8, 128
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %5
%12 = ashr i32 %11, 8
%13 = add nsw i32 %10, %12
%14 = ashr i32 %13, 8
ret i32 %14
}

LLVM IR (-O2):
define i32 @mul8bit(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = add nsw i32 %3, 128
%5 = ashr i32 %4, 8
%6 = add nsw i32 %5, %4
%7 = ashr i32 %6, 8
ret i32 %7
}
int EtatRelai(int index) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @EtatRelai(i32 %0) {
ret i32 1
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t read_32u(const uint8_t *src) {
  uint32_t b0 = ((uint32_t)src[0]) << 24;
  uint32_t b1 = ((uint32_t)src[1]) << 16;
  uint32_t b2 = ((uint32_t)src[2]) << 8;
  uint32_t b3 = ((uint32_t)src[3]);
  return (b0 | b1 | b2 | b3);
}


x86 assembly (clang, -O0):
<read_32u>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
shl    $0x18,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
shl    $0x10,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rax
shl    $0x8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%rax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
or     -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_32u>:
mov    (%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x18,%eax
shl    $0x10,%ecx
or     %eax,%ecx
mov    0x10(%rdi),%eax
shl    $0x8,%eax
or     %ecx,%eax
or     0x18(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @read_32u(i64* %0) {
%2 = alloca i64*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i64* %0, i64** %2
%7 = load i64*, i64** %2
%8 = getelementptr inbounds i64, i64* %7, i64 0
%9 = load i64, i64* %8
%10 = trunc i64 %9 to i32
%11 = shl i32 %10, 24
store i32 %11, i32* %3
%12 = load i64*, i64** %2
%13 = getelementptr inbounds i64, i64* %12, i64 1
%14 = load i64, i64* %13
%15 = trunc i64 %14 to i32
%16 = shl i32 %15, 16
store i32 %16, i32* %4
%17 = load i64*, i64** %2
%18 = getelementptr inbounds i64, i64* %17, i64 2
%19 = load i64, i64* %18
%20 = trunc i64 %19 to i32
%21 = shl i32 %20, 8
store i32 %21, i32* %5
%22 = load i64*, i64** %2
%23 = getelementptr inbounds i64, i64* %22, i64 3
%24 = load i64, i64* %23
%25 = trunc i64 %24 to i32
store i32 %25, i32* %6
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = or i32 %26, %27
%29 = load i32, i32* %5
%30 = or i32 %28, %29
%31 = load i32, i32* %6
%32 = or i32 %30, %31
ret i32 %32
}

LLVM IR (-O2):
define i32 @read_32u(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = shl i32 %3, 24
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 16
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 8
%13 = getelementptr inbounds i64, i64* %0, i64 3
%14 = load i64, i64* %13
%15 = trunc i64 %14 to i32
%16 = or i32 %8, %4
%17 = or i32 %16, %12
%18 = or i32 %17, %15
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("This is a simple test.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [23 x i8] c"This is a simple test.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double get_time(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (double)tv.tv_sec + (double)tv.tv_usec / 1000000.0;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq -0x8(%rbp),%xmm0
cvtsi2sdq -0x10(%rbp),%xmm1
movsd  0xec7(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
divsd  0xeca(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%4 = load i64, i64* %3
%5 = sitofp i64 %4 to double
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%7 = load i64, i64* %6
%8 = sitofp i64 %7 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @get_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = sitofp i64 %5 to double
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = fdiv double %9, 1.000000e+06
%11 = fadd double %10, %6
ret double %11
}
/* Type definitions */
struct sqlConnection {
  int dummy;
};

/* Variables and functions */
char *indirectString(struct sqlConnection *, int, char *, char *);
char *submissionSetPart(struct sqlConnection *conn, int id, char *field) {
  return indirectString(conn, id, "submissionSet", field);
}


x86 assembly (clang, -O0):
<submissionSetPart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rcx
lea    0xecb(%rip),%rdx
call   1030 <indirectString@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<submissionSetPart>:
mov    %rdx,%rcx
lea    0xee6(%rip),%rdx
jmp    1030 <indirectString@plt>

LLVM IR (-O0):
%struct.sqlConnection = type { i32 }
@.str = [14 x i8] c"submissionSet\00"
define i8* @submissionSetPart(%struct.sqlConnection* %0, i32 %1, i8* %2) {
%4 = alloca %struct.sqlConnection*
%5 = alloca i32
%6 = alloca i8*
store %struct.sqlConnection* %0, %struct.sqlConnection** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.sqlConnection*, %struct.sqlConnection** %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i8* @indirectString(%struct.sqlConnection* %7, i32 %8, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i8* %10
}

LLVM IR (-O2):
%struct.sqlConnection = type { i32 }
@.str = [14 x i8] c"submissionSet\00"
define i8* @submissionSetPart(%struct.sqlConnection* %0, i32 %1, i8* %2) {
%4 = tail call i8* @indirectString(%struct.sqlConnection* %0, i32 %1, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %2)
ret i8* %4
}
int test_imm_F2int16_mem(short *val) {
  return ((*val) & (0xF2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F2int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, 242
%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_F2int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 242
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int foo(int n) { return (n == 1 || n == 2) ? 1 : foo(n - 1) * foo(n - 2); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
je     112f <foo+0x1f>
cmpl   $0x2,-0x4(%rbp)
jne    113c <foo+0x2c>
mov    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1160 <foo+0x50>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <foo@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <foo@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
mov    %edi,%ebx
add    $0xffffffff,%ebx
cmp    $0x2,%ebx
jb     112f <foo+0x1f>
nopl   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1030 <foo@plt>
add    $0xfffffffe,%ebx
cmp    $0x1,%ebx
ja     1120 <foo+0x10>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 2
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %9, %4 ], [ %2, %1 ]
%6 = phi i32 [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @foo(i32 %5)
%8 = add nsw i32 %6, -2
%9 = add i32 %6, -3
%10 = icmp ult i32 %9, 2
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int XQueryKeymap() {
  printf("XQueryKeymap called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [21 x i8] c"XQueryKeymap called\0A\00"
define i32 @XQueryKeymap() {
%1 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [20 x i8] c"XQueryKeymap called\00"
define i32 @XQueryKeymap() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ gdb_unbuffer_output();
int /*<<< orphan*/ test();
int main(void) {
  gdb_unbuffer_output();
  test();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gdb_unbuffer_output@plt>
mov    $0x0,%al
call   1040 <test@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @gdb_unbuffer_output()
%2 = call i32 (...) @test()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gdb_unbuffer_output()
%2 = tail call i32 (...) @test()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void sds_free(void *ptr) { free(ptr); }


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

x86 assembly (clang, -O2):
<sds_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @sds_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
unsigned xrop3_191_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T & S;
  stk2 = ~stk2;
  stk1 = D | stk2;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_191_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
or     -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_191_0_1>:
mov    %edi,%ecx
shl    $0x8,%ecx
mov    %esi,%edx
shl    $0x8,%edx
lea    (%rdx,%rsi,1),%eax
and    %ecx,%edx
or     %edi,%ecx
xor    %edx,%ecx
not    %eax
not    %edi
and    %esi,%edi
or     %edi,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_191_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = or i32 %4, %3
%6 = zext i8 %1 to i32
%7 = shl nuw nsw i32 %6, 8
%8 = or i32 %7, %6
%9 = and i32 %7, %4
%10 = xor i32 %9, %5
%11 = xor i32 %8, -1
%12 = xor i32 %3, -1
%13 = and i32 %12, %6
%14 = or i32 %13, %11
%15 = or i32 %14, %10
ret i32 %15
}
char *opakuj(char i, char *kam) {
  if (i == 0)
    return kam;
  char znak = '+';
  if (i < 0) {
    i = -i;
    znak = '-';
  }
  while (i--) {
    *kam = znak;
    kam++;
  }
  return kam;
}


x86 assembly (clang, -O0):
<opakuj>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
mov    %rsi,-0x18(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    1128 <opakuj+0x28>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1182 <opakuj+0x82>
movb   $0x2b,-0x19(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jge    1148 <opakuj+0x48>
movsbl -0x9(%rbp),%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %al,-0x9(%rbp)
movb   $0x2d,-0x19(%rbp)
jmp    114d <opakuj+0x4d>
mov    -0x9(%rbp),%al
mov    %al,%cl
add    $0xff,%cl
mov    %cl,-0x9(%rbp)
cmp    $0x0,%al
je     117a <opakuj+0x7a>
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    114d <opakuj+0x4d>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<opakuj>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
test   %dil,%dil
je     114f <opakuj+0x3f>
mov    %edi,%eax
sar    $0x7,%al
lea    (%rdi,%rax,1),%ecx
xor    %al,%cl
movzbl %cl,%ebx
shr    $0x7,%dil
movzbl %dil,%eax
lea    (%rax,%rax,1),%esi
add    $0x2b,%esi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1030 <memset@plt>
add    $0xff,%bl
movzbl %bl,%eax
add    %rax,%r14
add    $0x1,%r14
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @opakuj(i8 signext %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8*
%6 = alloca i8
store i8 %0, i8* %4
store i8* %1, i8** %5
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i8*, i8** %5
store i8* %11, i8** %3
br label %33
12: ; preds = %2
store i8 43, i8* %6
%13 = load i8, i8* %4
%14 = sext i8 %13 to i32
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = sub nsw i32 0, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %4
store i8 45, i8* %6
br label %21
21: ; preds = %16, %12
br label %22
22: ; preds = %26, %21
%23 = load i8, i8* %4
%24 = add i8 %23, -1
store i8 %24, i8* %4
%25 = icmp ne i8 %23, 0
br i1 %25, label %26, label %31
26: ; preds = %22
%27 = load i8, i8* %6
%28 = load i8*, i8** %5
store i8 %27, i8* %28
%29 = load i8*, i8** %5
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %5
br label %22
31: ; preds = %22
%32 = load i8*, i8** %5
store i8* %32, i8** %3
br label %33
33: ; preds = %31, %10
%34 = load i8*, i8** %3
ret i8* %34
}

LLVM IR (-O2):
define i8* @opakuj(i8 signext %0, i8* writeonly %1) {
%3 = icmp eq i8 %0, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = icmp slt i8 %0, 0
%6 = sub i8 0, %0
%7 = select i1 %5, i8 %6, i8 %0
%8 = select i1 %5, i8 45, i8 43
%9 = zext i8 %7 to i64
%10 = add i8 %7, -1
%11 = zext i8 %10 to i64
%12 = add nuw nsw i64 %11, 1
%13 = getelementptr i8, i8* %1, i64 %12
br label %14
14: ; preds = %4, %2
%15 = phi i8* [ %1, %2 ], [ %13, %4 ]
ret i8* %15
}
void set_le32(void *p, unsigned long n) {
  ((unsigned char *)p)[0] = (unsigned char)n & (0xFF);
  ((unsigned char *)p)[1] = (unsigned char)(n >> 8) & (0xFF);
  ((unsigned char *)p)[2] = (unsigned char)(n >> 16) & (0xFF);
  ((unsigned char *)p)[3] = (unsigned char)(n >> 24) & (0xFF);
}


x86 assembly (clang, -O0):
<set_le32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl %al,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
shr    $0x8,%rax
movzbl %al,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x10(%rbp),%rax
shr    $0x10,%rax
movzbl %al,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x10(%rbp),%rax
shr    $0x18,%rax
movzbl %al,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_le32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_le32(i8* nocapture writeonly %0, i64 %1) {
%3 = trunc i64 %1 to i8
store i8 %3, i8* %0
%4 = lshr i64 %1, 8
%5 = trunc i64 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i64 %1, 16
%8 = trunc i64 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
%10 = lshr i64 %1, 24
%11 = trunc i64 %10 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
int isReadable(int msg) {
  int retValue_acc;
  {
    retValue_acc = 1;
    return (retValue_acc);
    return (retValue_acc);
  }
}


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

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

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

LLVM IR (-O2):
define i32 @isReadable(i32 %0) {
ret i32 1
}
void f(int n) {
  if (n > 0)
    f(n - 2), printf("%d ", n);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1151 <f+0x31>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
call   1030 <f@plt>
mov    -0x4(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
test   %edi,%edi
jle    1140 <f+0x20>
push   %rbx
mov    %edi,%ebx
lea    -0x2(%rbx),%edi
call   1030 <f@plt>
lea    0xeca(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @f(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1, %4
ret void
4: ; preds = %1
%5 = add nsw i32 %0, -2
tail call void @f(i32 %5)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %3
}
f(a, b, c, d, e, f, g, h) {
  return (a << 0) + (b << 1) + (c << 2) + (d << 3) + (e << 4) + (f << 5) +
         (g << 6) + (h << 7);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x0,%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x4,%ecx
add    %ecx,%eax
mov    -0x18(%rbp),%ecx
shl    $0x5,%ecx
add    %ecx,%eax
mov    0x10(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    0x18(%rbp),%ecx
shl    $0x7,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
mov    0x10(%rsp),%eax
mov    0x8(%rsp),%r10d
lea    (%rdi,%rsi,2),%esi
lea    (%rsi,%rdx,4),%edx
lea    (%rdx,%rcx,8),%ecx
shl    $0x4,%r8d
add    %r8d,%ecx
shl    $0x5,%r9d
add    %r9d,%ecx
shl    $0x6,%r10d
add    %ecx,%r10d
shl    $0x7,%eax
add    %r10d,%eax
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%17 = load i32, i32* %9
%18 = shl i32 %17, 0
%19 = load i32, i32* %10
%20 = shl i32 %19, 1
%21 = add nsw i32 %18, %20
%22 = load i32, i32* %11
%23 = shl i32 %22, 2
%24 = add nsw i32 %21, %23
%25 = load i32, i32* %12
%26 = shl i32 %25, 3
%27 = add nsw i32 %24, %26
%28 = load i32, i32* %13
%29 = shl i32 %28, 4
%30 = add nsw i32 %27, %29
%31 = load i32, i32* %14
%32 = shl i32 %31, 5
%33 = add nsw i32 %30, %32
%34 = load i32, i32* %15
%35 = shl i32 %34, 6
%36 = add nsw i32 %33, %35
%37 = load i32, i32* %16
%38 = shl i32 %37, 7
%39 = add nsw i32 %36, %38
ret i32 %39
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = shl i32 %1, 1
%10 = add nsw i32 %9, %0
%11 = shl i32 %2, 2
%12 = add nsw i32 %10, %11
%13 = shl i32 %3, 3
%14 = add nsw i32 %12, %13
%15 = shl i32 %4, 4
%16 = add nsw i32 %14, %15
%17 = shl i32 %5, 5
%18 = add nsw i32 %16, %17
%19 = shl i32 %6, 6
%20 = add nsw i32 %18, %19
%21 = shl i32 %7, 7
%22 = add nsw i32 %20, %21
ret i32 %22
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int __original_open(char const *, int, int /*<<< orphan*/);
int /*<<< orphan*/ lic_fadv_dont(int);
int open(const char *pathname, int flags, mode_t mode) {
  int ret = -1;
  ret = __original_open(pathname, flags, mode);
  if (ret != -1)
    lic_fadv_dont(ret);
  return ret;
}


x86 assembly (clang, -O0):
<open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <__original_open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0xffffffff,-0x14(%rbp)
je     115d <open+0x3d>
mov    -0x14(%rbp),%edi
call   1030 <lic_fadv_dont@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open>:
push   %rbx
call   1040 <__original_open@plt>
mov    %eax,%ebx
cmp    $0xffffffff,%eax
je     1134 <open+0x14>
mov    %ebx,%edi
call   1030 <lic_fadv_dont@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @open(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 @__original_open(i8* %0, i32 %1, i32 %2)
%5 = icmp eq i32 %4, -1
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @lic_fadv_dont(i32 %4)
br label %8
8: ; preds = %6, %3
ret i32 %4
}
int test_imm_FFuint16_reg(unsigned short val) {
  return ((val) & (-0xFF << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_FFuint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff01,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_FFuint16_reg>:
test   $0xff01,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_FFuint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -255
%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_FFuint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -255
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int getRegLo(int *context) { return *(context + 6); }


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

x86 assembly (clang, -O2):
<getRegLo>:
mov    0x18(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @getRegLo(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 6
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void clean(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<clean>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @clean(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __auto_free__(void *p) { free(*(void **)p); }


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

x86 assembly (clang, -O2):
<__auto_free__>:
mov    (%rdi),%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @__auto_free__(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i8**
%5 = load i8*, i8** %4
%6 = call i32 @free(i8* %5)
ret void
}

LLVM IR (-O2):
define void @__auto_free__(i8* nocapture %0) {
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ idt_initialize();
int /*<<< orphan*/ kb_initialize();
int /*<<< orphan*/ kernel_draw_prozum_logo();
void kernel_entry_main() {
  kernel_draw_prozum_logo();
  idt_initialize();
  kb_initialize();
  while (1 != 0)
    ;
}


x86 assembly (clang, -O0):
<kernel_entry_main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <kernel_draw_prozum_logo@plt>
mov    $0x0,%al
call   1050 <idt_initialize@plt>
mov    $0x0,%al
call   1040 <kb_initialize@plt>
jmp    1149 <kernel_entry_main+0x19>

x86 assembly (clang, -O2):
<kernel_entry_main>:
push   %rax
xor    %eax,%eax
call   1030 <kernel_draw_prozum_logo@plt>
xor    %eax,%eax
call   1050 <idt_initialize@plt>
xor    %eax,%eax
call   1040 <kb_initialize@plt>
cs nopw 0x0(%rax,%rax,1)
jmp    1150 <kernel_entry_main+0x20>

LLVM IR (-O0):
define void @kernel_entry_main() {
%1 = call i32 (...) @kernel_draw_prozum_logo()
%2 = call i32 (...) @idt_initialize()
%3 = call i32 (...) @kb_initialize()
br label %4
4: ; preds = %0, %4
br label %4
}

LLVM IR (-O2):
define void @kernel_entry_main() {
%1 = tail call i32 (...) @kernel_draw_prozum_logo()
%2 = tail call i32 (...) @idt_initialize()
%3 = tail call i32 (...) @kb_initialize()
br label %4
4: ; preds = %0, %4
br label %4
}
int omap4_duty_cycle_register(struct duty_cycle *tduty) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.duty_cycle = type opaque
define i32 @omap4_duty_cycle_register(%struct.duty_cycle* nocapture readnone %0) {
ret i32 0
}