xunge/DecIR huggingface dataset:
int abs(int x) { return ((x ^ (x >> 31))) + (1 + (~(x >> 31))); }


x86 assembly (clang, -O0):
<abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
sar    $0x1f,%ecx
xor    $0xffffffff,%ecx
add    $0x1,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<abs>:
mov    %edi,%eax
sar    $0x1f,%eax
xor    %edi,%eax
shr    $0x1f,%edi
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @abs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = ashr i32 %4, 31
%6 = xor i32 %3, %5
%7 = load i32, i32* %2
%8 = ashr i32 %7, 31
%9 = xor i32 %8, -1
%10 = add nsw i32 1, %9
%11 = add nsw i32 %6, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @abs(i32 %0) {
%2 = lshr i32 %0, 31
%3 = ashr i32 %0, 31
%4 = xor i32 %3, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
int main(void) {
  char str[20];
  sprintf(str, "%d", 4321);
  printf("%s\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x20(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x10e1,%edx
call   1040 <sprintf@plt>
lea    -0x20(%rbp),%rsi
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xed4(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10e1,%edx
call   1040 <sprintf@plt>
lea    0xec0(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%s\0A\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 @sprintf(i8* %2, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 4321)
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pressEvKey(int);
int /*<<< orphan*/ releaseEvKey(int);
void sendEvKey(int evKey) {
  pressEvKey(evKey);
  releaseEvKey(evKey);
}


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

x86 assembly (clang, -O2):
<sendEvKey>:
push   %rbx
mov    %edi,%ebx
call   1030 <pressEvKey@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <releaseEvKey@plt>

LLVM IR (-O0):
define void @sendEvKey(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @pressEvKey(i32 %3)
%5 = load i32, i32* %2
%6 = call i32 @releaseEvKey(i32 %5)
ret void
}

LLVM IR (-O2):
define void @sendEvKey(i32 %0) {
%2 = tail call i32 @pressEvKey(i32 %0)
%3 = tail call i32 @releaseEvKey(i32 %0)
ret void
}
void endElement(void *userData, const char *name) {
  int *depthPtr = userData;
  *depthPtr -= 1;
}


x86 assembly (clang, -O0):
<endElement>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<endElement>:
addl   $0xffffffff,(%rdi)
ret

LLVM IR (-O0):
define void @endElement(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = sub nsw i32 %9, 1
store i32 %10, i32* %8
ret void
}

LLVM IR (-O2):
define void @endElement(i8* nocapture %0, i8* nocapture readnone %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = add nsw i32 %4, -1
store i32 %5, i32* %3
ret void
}
/* Variables and functions */
int z(int);
int y(int x) { return z(4); }


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

x86 assembly (clang, -O2):
<y>:
mov    $0x4,%edi
jmp    1030 <z@plt>

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

LLVM IR (-O2):
define i32 @y(i32 %0) {
%2 = tail call i32 @z(i32 4)
ret i32 %2
}
int deleteindex(int *a, int in, int n) {
  for (int i = in; i < n - 1; i++) {
    a[in] = a[in + 1];
  }
  n--;
  return n;
}


x86 assembly (clang, -O0):
<deleteindex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    114e <deleteindex+0x4e>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1114 <deleteindex+0x14>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<deleteindex>:
mov    %edx,%eax
add    $0xffffffff,%eax
cmp    %esi,%eax
jle    1113 <deleteindex+0x13>
movslq %esi,%rcx
mov    0x4(%rdi,%rcx,4),%edx
mov    %edx,(%rdi,%rcx,4)
ret

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

LLVM IR (-O2):
define i32 @deleteindex(i32* nocapture %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = icmp sgt i32 %4, %1
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = add nsw i32 %1, 1
%8 = sext i32 %7 to i64
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %8
%11 = getelementptr inbounds i32, i32* %0, i64 %9
%12 = load i32, i32* %10
store i32 %12, i32* %11
br label %13
13: ; preds = %6, %3
ret i32 %4
}
int test_imm_BBuint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0xBB << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_BBuint64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x10,%rdx
and    $0xbb,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_BBuint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 187
%7 = icmp ne i64 %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_BBuint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 12255232
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
void *malloc(int);
int /*<<< orphan*/ stderr;
void *malloc_or_die(int num_bytes) {
  void *rv;
  rv = malloc(num_bytes);
  if (rv == 0) {
    fprintf(stderr, "malloc(%d) failed.\n", num_bytes);
    exit(1);
  }
  return rv;
}


x86 assembly (clang, -O0):
<malloc_or_die>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1174 <malloc_or_die+0x44>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xe9b(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<malloc_or_die>:
push   %rbx
mov    %edi,%ebx
call   1040 <malloc@plt>
test   %rax,%rax
je     113f <malloc_or_die+0xf>
pop    %rbx
ret
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"malloc(%d) failed.\0A\00"
define noalias i8* @malloc_or_die(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Type definitions */
struct event_base {
  int dummy;
};

/* Variables and functions */
struct event_base *event_init();
struct event_base *osdep_event_init(void) {
  return (event_init());
}


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

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

LLVM IR (-O0):
%struct.event_base = type { i32 }
define %struct.event_base* @osdep_event_init() {
%1 = call %struct.event_base* (...) @event_init()
ret %struct.event_base* %1
}

LLVM IR (-O2):
%struct.event_base = type { i32 }
define %struct.event_base* @osdep_event_init() {
%1 = tail call %struct.event_base* (...) @event_init()
ret %struct.event_base* %1
}
/* Variables and functions */
unsigned short aba_value(void *a) { return (intptr_t)a & 0xffff; }


x86 assembly (clang, -O0):
<aba_value>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aba_value>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define zeroext i16 @aba_value(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = and i64 %4, 65535
%6 = trunc i64 %5 to i16
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @aba_value(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = trunc i64 %2 to i16
ret i16 %3
}
void comexec_Help() {}


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

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

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

LLVM IR (-O2):
define void @comexec_Help() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ runServer();
int main(int argc, char **argv) {
  runServer();
  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)
mov    $0x0,%al
call   1030 <runServer@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 (...) @runServer()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @runServer()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ digest_to_string(char *, unsigned char *, int);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
void print_as_hex(unsigned char *digest, int len) {
  char *bu;
  bu = malloc(2 * len + 1);
  digest_to_string(bu, digest, len);
  printf("%s", bu);
}


x86 assembly (clang, -O0):
<print_as_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
shl    $0x1,%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <digest_to_string@plt>
mov    -0x18(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_as_hex>:
push   %r15
push   %r14
push   %rbx
mov    %esi,%r15d
mov    %rdi,%r14
lea    (%r15,%r15,1),%edi
add    $0x1,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15d,%edx
call   1050 <digest_to_string@plt>
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @print_as_hex(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 = mul nsw i32 2, %6
%8 = add nsw i32 %7, 1
%9 = call i8* @malloc(i32 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = load i32, i32* %4
%13 = call i32 @digest_to_string(i8* %10, i8* %11, i32 %12)
%14 = load i8*, i8** %5
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @print_as_hex(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = or i32 %3, 1
%5 = tail call i8* @malloc(i32 %4)
%6 = tail call i32 @digest_to_string(i8* %5, i8* %0, i32 %1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}
int ext5_acl_chmod(struct inode *inode) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.inode = type opaque
define i32 @ext5_acl_chmod(%struct.inode* nocapture readnone %0) {
ret i32 0
}
unsigned int u_char_size(unsigned int uch) {
  if (uch <= 0x7fU)
    return 1;
  if (uch <= 0x7ffU)
    return 2;
  if (uch <= 0xffffU)
    return 3;
  if (uch <= 0x10ffffU)
    return 4;
  return 1;
}


x86 assembly (clang, -O0):
<u_char_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
ja     111d <u_char_size+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    116f <u_char_size+0x6f>
cmpl   $0x7ff,-0x8(%rbp)
ja     1136 <u_char_size+0x36>
movl   $0x2,-0x4(%rbp)
jmp    116f <u_char_size+0x6f>
cmpl   $0xffff,-0x8(%rbp)
ja     114f <u_char_size+0x4f>
movl   $0x3,-0x4(%rbp)
jmp    116f <u_char_size+0x6f>
cmpl   $0x10ffff,-0x8(%rbp)
ja     1168 <u_char_size+0x68>
movl   $0x4,-0x4(%rbp)
jmp    116f <u_char_size+0x6f>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<u_char_size>:
mov    $0x1,%eax
cmp    $0x80,%edi
jb     1138 <u_char_size+0x38>
mov    $0x2,%eax
cmp    $0x800,%edi
jb     1138 <u_char_size+0x38>
mov    $0x3,%eax
cmp    $0x10000,%edi
jb     1138 <u_char_size+0x38>
xor    %eax,%eax
cmp    $0x110000,%edi
setb   %al
lea    (%rax,%rax,2),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @u_char_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ule i32 %4, 127
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %20
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp ule i32 %8, 2047
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 2, i32* %2
br label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp ule i32 %12, 65535
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 3, i32* %2
br label %20
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp ule i32 %16, 1114111
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 4, i32* %2
br label %20
19: ; preds = %15
store i32 1, i32* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @u_char_size(i32 %0) {
%2 = icmp ult i32 %0, 128
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 2048
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 65536
br i1 %6, label %10, label %7
7: ; preds = %5
%8 = icmp ult i32 %0, 1114112
%9 = select i1 %8, i32 4, i32 1
br label %10
10: ; preds = %7, %5, %3, %1
%11 = phi i32 [ 1, %1 ], [ 2, %3 ], [ 3, %5 ], [ %9, %7 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
float ffjjdi(float f, uint64_t j, uint64_t j2, double d, uint32_t i) {
  return 0.0;
}


x86 assembly (clang, -O0):
<ffjjdi>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
xorps  %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffjjdi>:
xorps  %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @ffjjdi(float %0, i32 %1, i32 %2, double %3, i32 %4) {
%6 = alloca float
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca i32
store float %0, float* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store double %3, double* %9
store i32 %4, i32* %10
ret float 0.000000e+00
}

LLVM IR (-O2):
define float @ffjjdi(float %0, i32 %1, i32 %2, double %3, i32 %4) {
ret float 0.000000e+00
}
int nametokeypress_i(int i, int flags) {
  if (i < 6)
    return 1 + i | flags;
  if (i == 12)
    return 0;
  return (i < 11 ? 3 + i - 7 : ' ') | 0x100 | flags;
}


x86 assembly (clang, -O0):
<nametokeypress_i>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    1125 <nametokeypress_i+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1171 <nametokeypress_i+0x71>
cmpl   $0xc,-0x8(%rbp)
jne    113b <nametokeypress_i+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1171 <nametokeypress_i+0x71>
cmpl   $0xb,-0x8(%rbp)
jge    1156 <nametokeypress_i+0x56>
mov    -0x8(%rbp),%eax
add    $0x3,%eax
sub    $0x7,%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <nametokeypress_i+0x63>
mov    $0x20,%eax
mov    %eax,-0x10(%rbp)
jmp    1163 <nametokeypress_i+0x63>
mov    -0x10(%rbp),%eax
or     $0x100,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nametokeypress_i>:
cmp    $0x5,%edi
jg     110d <nametokeypress_i+0xd>
add    $0x1,%edi
or     %esi,%edi
mov    %edi,%eax
ret
xor    %eax,%eax
cmp    $0xc,%edi
je     112a <nametokeypress_i+0x2a>
lea    -0x4(%rdi),%ecx
or     $0x100,%ecx
cmp    $0xb,%edi
mov    $0x120,%eax
cmovb  %ecx,%eax
or     %esi,%eax
ret

LLVM IR (-O0):
define i32 @nametokeypress_i(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 = icmp slt i32 %6, 6
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i32, i32* %4
%10 = add nsw i32 1, %9
%11 = load i32, i32* %5
%12 = or i32 %10, %11
store i32 %12, i32* %3
br label %30
13: ; preds = %2
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 12
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 0, i32* %3
br label %30
17: ; preds = %13
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 11
br i1 %19, label %20, label %24
20: ; preds = %17
%21 = load i32, i32* %4
%22 = add nsw i32 3, %21
%23 = sub nsw i32 %22, 7
br label %25
24: ; preds = %17
br label %25
25: ; preds = %24, %20
%26 = phi i32 [ %23, %20 ], [ 32, %24 ]
%27 = or i32 %26, 256
%28 = load i32, i32* %5
%29 = or i32 %27, %28
store i32 %29, i32* %3
br label %30
30: ; preds = %25, %16, %8
%31 = load i32, i32* %3
ret i32 %31
}

LLVM IR (-O2):
define i32 @nametokeypress_i(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 6
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = add nsw i32 %0, 1
%6 = or i32 %5, %1
br label %15
7: ; preds = %2
%8 = icmp eq i32 %0, 12
br i1 %8, label %15, label %9
9: ; preds = %7
%10 = icmp ult i32 %0, 11
%11 = add nsw i32 %0, -4
%12 = or i32 %11, 256
%13 = select i1 %10, i32 %12, i32 288
%14 = or i32 %13, %1
br label %15
15: ; preds = %7, %9, %4
%16 = phi i32 [ %6, %4 ], [ %14, %9 ], [ 0, %7 ]
ret i32 %16
}
/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ fd_nrf8001_broadcast_error(int);
int /*<<< orphan*/ fd_nrf8001_broadcast_success();
void fd_nrf8001_dispatch_broadcast_response(uint8_t status,
                                            uint8_t *response_data
                                            __attribute__((unused)),
                                            uint32_t response_data_length
                                            __attribute__((unused))) {
  if (status != 0x00) {
    fd_nrf8001_broadcast_error(status);
    return;
  }
  fd_nrf8001_broadcast_success();
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <fd_nrf8001_dispatch_broadcast_response+0x29>
mov    -0x4(%rbp),%edi
call   1030 <fd_nrf8001_broadcast_error@plt>
jmp    1150 <fd_nrf8001_dispatch_broadcast_response+0x30>
mov    $0x0,%al
call   1040 <fd_nrf8001_broadcast_success@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
test   %edi,%edi
je     1129 <fd_nrf8001_dispatch_broadcast_response+0x9>
jmp    1030 <fd_nrf8001_broadcast_error@plt>
xor    %eax,%eax
jmp    1040 <fd_nrf8001_broadcast_success@plt>

LLVM IR (-O0):
define void @fd_nrf8001_dispatch_broadcast_response(i32 %0, i32* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
store i32 %0, i32* %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %4
%11 = call i32 @fd_nrf8001_broadcast_error(i32 %10)
br label %14
12: ; preds = %3
%13 = call i32 (...) @fd_nrf8001_broadcast_success()
br label %14
14: ; preds = %12, %9
ret void
}

LLVM IR (-O2):
define void @fd_nrf8001_dispatch_broadcast_response(i32 %0, i32* nocapture readnone %1, i32 %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 @fd_nrf8001_broadcast_error(i32 %0)
br label %9
7: ; preds = %3
%8 = tail call i32 (...) @fd_nrf8001_broadcast_success()
br label %9
9: ; preds = %7, %5
ret void
}
int test_imm_2Cuint8_reg(unsigned char val) {
  return ((val) & (-0x2C << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_2Cuint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffd4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_2Cuint8_reg>:
test   $0xd4,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_2Cuint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -44
%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_2Cuint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -44
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *xcalloc(size_t nmemb, size_t size) {
  void *ptr = calloc(nmemb, size);
  if (!ptr) {
    fprintf(stderr, "out of memory\n");
    exit(1);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<xcalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117b <xcalloc+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xcalloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <xcalloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define i8* @xcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = load i8*, i8** %5
ret i8* %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"out of memory\0A\00"
define noalias i8* @xcalloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isSTORE(const char *comm) { return strcmp(comm, "store") == 0; }


x86 assembly (clang, -O0):
<isSTORE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"store\00"
define i32 @isSTORE(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [6 x i8] c"store\00"
define i32 @isSTORE(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int test_imm_38uint8_reg(unsigned char val) {
  return ((val) & (-0x38 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_38uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffc8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_38uint8_reg>:
test   $0xc8,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_38uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -56
%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_38uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -56
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int input_n();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ system(char *);
int main() {
  int n1;
  int n2;
  n1 = input_n();
  n2 = input_n();
  if (n1 > n2) {
    printf("Il numero piu' grande e' %d \n", n1);
  } else {
    printf("Il numero piu' grande e' %d \n", n2);
  }
  system("PAUSE");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <input_n@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <input_n@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1173 <main+0x43>
mov    -0x8(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1050 <printf@plt>
jmp    1182 <main+0x52>
mov    -0xc(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1050 <printf@plt>
lea    0xe95(%rip),%rdi
call   1040 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <input_n@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <input_n@plt>
cmp    %eax,%ebx
cmovle %eax,%ebx
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
call   1050 <printf@plt>
lea    0xec3(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Il numero piu' grande e' %d \0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @input_n()
store i32 %4, i32* %2
%5 = call i32 (...) @input_n()
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = icmp sgt i32 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %10)
br label %15
12: ; preds = %0
%13 = load i32, i32* %3
%14 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %9
%16 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [30 x i8] c"Il numero piu' grande e' %d \0A\00"
@.str.1 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = tail call i32 (...) @input_n()
%2 = tail call i32 (...) @input_n()
%3 = icmp sgt i32 %1, %2
%4 = select i1 %3, i32 %1, i32 %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
void ata_sas_free_tag(unsigned int tag, struct ata_port *ap) {}


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

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

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

LLVM IR (-O2):
%struct.ata_port = type opaque
define void @ata_sas_free_tag(i32 %0, %struct.ata_port* nocapture %1) {
ret void
}
/* Variables and functions */
int getpid();
int getppid();
int /*<<< orphan*/ printf(char *, int, int);
void printStuff() { printf("Processo pai %d criou %d\n", getppid(), getpid()); }


x86 assembly (clang, -O0):
<printStuff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getppid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x4(%rbp),%esi
mov    %eax,%edx
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printStuff>:
push   %rbx
xor    %eax,%eax
call   1050 <getppid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xeb8(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Processo pai %d criou %d\0A\00"
define void @printStuff() {
%1 = call i32 (...) @getppid()
%2 = call i32 (...) @getpid()
%3 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Processo pai %d criou %d\0A\00"
define void @printStuff() {
%1 = tail call i32 (...) @getppid()
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ op_write1(int);
void op_enc_inc_bc(void) { op_write1(0x03); }


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

x86 assembly (clang, -O2):
<op_enc_inc_bc>:
mov    $0x3,%edi
jmp    1030 <op_write1@plt>

LLVM IR (-O0):
define void @op_enc_inc_bc() {
%1 = call i32 @op_write1(i32 3)
ret void
}

LLVM IR (-O2):
define void @op_enc_inc_bc() {
%1 = tail call i32 @op_write1(i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *trim(char const *);
int /*<<< orphan*/ wrtsac2(char *, int, float const *, float const *);
void wrtsac2_(const char *name2, int n, const float *x, const float *y) {
  char *name;
  name = trim(name2);
  wrtsac2(name, n, x, y);
  free(name);
}


x86 assembly (clang, -O0):
<wrtsac2_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <trim@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1050 <wrtsac2@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wrtsac2_>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%ebp
call   1040 <trim@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1050 <wrtsac2@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @wrtsac2_(i8* %0, i32 %1, float* %2, float* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca float*
%8 = alloca float*
%9 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store float* %2, float** %7
store float* %3, float** %8
%10 = load i8*, i8** %5
%11 = call i8* @trim(i8* %10)
store i8* %11, i8** %9
%12 = load i8*, i8** %9
%13 = load i32, i32* %6
%14 = load float*, float** %7
%15 = load float*, float** %8
%16 = call i32 @wrtsac2(i8* %12, i32 %13, float* %14, float* %15)
%17 = load i8*, i8** %9
%18 = call i32 @free(i8* %17)
ret void
}

LLVM IR (-O2):
define void @wrtsac2_(i8* %0, i32 %1, float* %2, float* %3) {
%5 = tail call i8* @trim(i8* %0)
%6 = tail call i32 @wrtsac2(i8* %5, i32 %1, float* %2, float* %3)
%7 = tail call i32 @free(i8* %5)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ cc;
typedef int /*<<< orphan*/ bb;
typedef int /*<<< orphan*/ aa;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void main() {
  struct A {
    int a;
    double b;
    char c;
  };
  struct B {
    double b;
    char c;
    int a;
  };
  struct C {
    int a;
    char c;
    double b;
  };
  struct A aa;
  struct B bb;
  struct C cc;
  printf("A=%d\n", sizeof(aa));
  printf("B=%d\n", sizeof(bb));
  printf("C=%d\n", sizeof(cc));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xee1(%rip),%rdi
mov    $0x18,%esi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
lea    0xecb(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x18,%esi
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x10,%esi
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x10,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.A = type { i32, double, i8 }
%struct.B = type { double, i8, i32 }
%struct.C = type { i32, i8, double }
@.str = [6 x i8] c"A=%d\0A\00"
@.str.1 = [6 x i8] c"B=%d\0A\00"
@.str.2 = [6 x i8] c"C=%d\0A\00"
define void @main() {
%1 = alloca %struct.A
%2 = alloca %struct.B
%3 = alloca %struct.C
%4 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 24)
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 16)
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 16)
ret void
}

LLVM IR (-O2):
%struct.A = type { i32, double, i8 }
%struct.B = type { double, i8, i32 }
%struct.C = type { i32, i8, double }
@.str = [6 x i8] c"A=%d\0A\00"
@.str.1 = [6 x i8] c"B=%d\0A\00"
@.str.2 = [6 x i8] c"C=%d\0A\00"
define void @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 24)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 16)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 16)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pr_inf_skip(char *, char const *);
int /*<<< orphan*/ stress_check_capability(int);
int stress_binderfs_supported(const char *name) {
  if (!stress_check_capability((-1))) {
    pr_inf_skip("%s stressor will be skipped, "
                "need to be running with CAP_SYS_ADMIN "
                "rights for this stressor\n",
                name);
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<stress_binderfs_supported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0xffffffff,%edi
call   1030 <stress_check_capability@plt>
cmp    $0x0,%eax
jne    115b <stress_binderfs_supported+0x3b>
mov    -0x10(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1040 <pr_inf_skip@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1162 <stress_binderfs_supported+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stress_binderfs_supported>:
push   %rbx
mov    %rdi,%rbx
mov    $0xffffffff,%edi
call   1030 <stress_check_capability@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1138 <stress_binderfs_supported+0x18>
pop    %rbx
ret
lea    0xec1(%rip),%rdi
mov    %rbx,%rsi
call   1040 <pr_inf_skip@plt>
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [93 x i8] c"%s stressor will be skipped, need to be running with CAP_SYS_ADMIN rights for this stressor\0A\00"
define i32 @stress_binderfs_supported(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @stress_check_capability(i32 -1)
%5 = icmp ne i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i32 @pr_inf_skip(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* %7)
store i32 -1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [93 x i8] c"%s stressor will be skipped, need to be running with CAP_SYS_ADMIN rights for this stressor\0A\00"
define i32 @stress_binderfs_supported(i8* %0) {
%2 = tail call i32 @stress_check_capability(i32 -1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pr_inf_skip(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ -1, %4 ], [ 0, %1 ]
ret i32 %7
}
unsigned xrop3_161_0_0(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;
  unsigned stk3;
  unsigned stk4;
  stk4 = ~T;
  stk3 = S & stk4;
  stk2 = D | stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


x86 assembly (clang, -O0):
<xrop3_161_0_0>:
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
xor    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
and    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @xrop3_161_0_0(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
%10 = alloca i32
%11 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = shl i32 %13, 8
%15 = load i8, i8* %3
%16 = zext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 8
%21 = load i8, i8* %4
%22 = zext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %7
%24 = load i32, i32* %7
%25 = xor i32 %24, -1
store i32 %25, i32* %11
%26 = load i32, i32* %6
%27 = load i32, i32* %11
%28 = and i32 %26, %27
store i32 %28, i32* %10
%29 = load i32, i32* %5
%30 = load i32, i32* %10
%31 = or i32 %29, %30
store i32 %31, i32* %9
%32 = load i32, i32* %7
%33 = load i32, i32* %9
%34 = xor i32 %32, %33
store i32 %34, i32* %8
%35 = load i32, i32* %8
%36 = xor i32 %35, -1
store i32 %36, i32* %8
%37 = load i32, i32* %8
ret i32 %37
}

LLVM IR (-O2):
define i32 @xrop3_161_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %5
%8 = xor i32 %6, -1
%9 = and i32 %4, %8
%10 = or i32 %9, 255
%11 = xor i32 %7, %10
%12 = xor i32 %11, -1
ret i32 %12
}
/* Type definitions */
struct ibuf {
  int dummy;
};

/* Variables and functions */
size_t ibuf_capacity(struct ibuf const *);
size_t ibuf_nr_read(struct ibuf const *);
size_t ibuf_remaining(const struct ibuf *ib) {
  return ibuf_capacity(ib) - ibuf_nr_read(ib);
}


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

x86 assembly (clang, -O2):
<ibuf_remaining>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <ibuf_capacity@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <ibuf_nr_read@plt>
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.ibuf = type { i32 }
define i64 @ibuf_remaining(%struct.ibuf* %0) {
%2 = alloca %struct.ibuf*
store %struct.ibuf* %0, %struct.ibuf** %2
%3 = load %struct.ibuf*, %struct.ibuf** %2
%4 = call i64 @ibuf_capacity(%struct.ibuf* %3)
%5 = load %struct.ibuf*, %struct.ibuf** %2
%6 = call i64 @ibuf_nr_read(%struct.ibuf* %5)
%7 = sub i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.ibuf = type { i32 }
define i64 @ibuf_remaining(%struct.ibuf* %0) {
%2 = tail call i64 @ibuf_capacity(%struct.ibuf* %0)
%3 = tail call i64 @ibuf_nr_read(%struct.ibuf* %0)
%4 = sub i64 %2, %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rtkl_usage(void) {
  printf("RTKL options:\n"
         "--rtkl\n"
         "      select RTKL application.\n"
         "--rtkl-interval=<ms>\n"
         "      specify check interval (ms) of file/directory table.\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [133 x i8] c"RTKL options:\0A--rtkl\0A select RTKL application.\0A--rtkl-interval=<ms>\0A specify check interval (ms) of file/directory table.\0A\00"
define void @rtkl_usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([133 x i8], [133 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [132 x i8] c"RTKL options:\0A--rtkl\0A select RTKL application.\0A--rtkl-interval=<ms>\0A specify check interval (ms) of file/directory table.\00"
define void @rtkl_usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([132 x i8], [132 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct forf_env {
  int dummy;
};

/* Variables and functions */
long forf_pop_num(struct forf_env *);
int /*<<< orphan*/ forf_push_num(struct forf_env *, int);
void forf_proc_ne(struct forf_env *env) {
  long a = forf_pop_num(env);
  long b = forf_pop_num(env);
  forf_push_num(env, b != a);
}


x86 assembly (clang, -O0):
<forf_proc_ne>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <forf_pop_num@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%esi
call   1040 <forf_push_num@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<forf_proc_ne>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <forf_pop_num@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <forf_pop_num@plt>
xor    %esi,%esi
cmp    %r14,%rax
setne  %sil
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <forf_push_num@plt>

LLVM IR (-O0):
%struct.forf_env = type { i32 }
define void @forf_proc_ne(%struct.forf_env* %0) {
%2 = alloca %struct.forf_env*
%3 = alloca i64
%4 = alloca i64
store %struct.forf_env* %0, %struct.forf_env** %2
%5 = load %struct.forf_env*, %struct.forf_env** %2
%6 = call i64 @forf_pop_num(%struct.forf_env* %5)
store i64 %6, i64* %3
%7 = load %struct.forf_env*, %struct.forf_env** %2
%8 = call i64 @forf_pop_num(%struct.forf_env* %7)
store i64 %8, i64* %4
%9 = load %struct.forf_env*, %struct.forf_env** %2
%10 = load i64, i64* %4
%11 = load i64, i64* %3
%12 = icmp ne i64 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @forf_push_num(%struct.forf_env* %9, i32 %13)
ret void
}

LLVM IR (-O2):
%struct.forf_env = type { i32 }
define void @forf_proc_ne(%struct.forf_env* %0) {
%2 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%3 = tail call i64 @forf_pop_num(%struct.forf_env* %0)
%4 = icmp ne i64 %3, %2
%5 = zext i1 %4 to i32
%6 = tail call i32 @forf_push_num(%struct.forf_env* %0, i32 %5)
ret void
}
int kvmppc_get_cap_safe_indirect_branch(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @kvmppc_get_cap_safe_indirect_branch() {
ret i32 0
}