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

/* Variables and functions */
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ TCP_CORK;
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
void set_tcp_uncork(int fd) {
  int state = 0;
  setsockopt(fd, IPPROTO_TCP, TCP_CORK, &state, sizeof(state));
}


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

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

LLVM IR (-O0):
@IPPROTO_TCP = global i32 0
@TCP_CORK = global i32 0
define void @set_tcp_uncork(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
%4 = load i32, i32* %2
%5 = load i32, i32* @IPPROTO_TCP
%6 = load i32, i32* @TCP_CORK
%7 = call i32 @setsockopt(i32 %4, i32 %5, i32 %6, i32* %3, i32 4)
ret void
}

LLVM IR (-O2):
@IPPROTO_TCP = global i32 0
@TCP_CORK = global i32 0
define void @set_tcp_uncork(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* @IPPROTO_TCP
%5 = load i32, i32* @TCP_CORK
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xb7() {
  Assert_real((isbdigit(183) == 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_isbdigit.c",
              920, ("isbdigit should be 0 for 0xb7"));
}


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

x86 assembly (clang, -O2):
<t_isbdigit_0xb7>:
push   %rax
mov    $0xb7,%edi
call   1040 <isbdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x398,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xb7\00"
define void @t_isbdigit_0xb7() {
%1 = call i64 @isbdigit(i32 183)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 920, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xb7\00"
define void @t_isbdigit_0xb7() {
%1 = tail call i64 @isbdigit(i32 183)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 920, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int isspace(int c) {
  return ((unsigned char)c == ' ') || ((unsigned char)c == '\t') ||
         ((unsigned char)c == '\n') || ((unsigned char)c == '\r') ||
         ((unsigned char)c == '\f') || ((unsigned char)c == '\v');
}


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
mov    $0x1,%al
cmp    $0x20,%ecx
mov    %al,-0x5(%rbp)
je     117a <isspace+0x7a>
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
mov    $0x1,%al
cmp    $0x9,%ecx
mov    %al,-0x5(%rbp)
je     117a <isspace+0x7a>
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x5(%rbp)
je     117a <isspace+0x7a>
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
mov    $0x1,%al
cmp    $0xd,%ecx
mov    %al,-0x5(%rbp)
je     117a <isspace+0x7a>
mov    -0x4(%rbp),%eax
movzbl %al,%ecx
mov    $0x1,%al
cmp    $0xc,%ecx
mov    %al,-0x5(%rbp)
je     117a <isspace+0x7a>
mov    -0x4(%rbp),%eax
movzbl %al,%eax
cmp    $0xb,%eax
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
cmp    $0x20,%dil
ja     1120 <isspace+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100003600,%rdx
bt     %rcx,%rdx
jae    1120 <isspace+0x20>
ret
xor    %eax,%eax
cmp    $0xb,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = trunc i32 %3 to i8
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 32
br i1 %6, label %32, label %7
7: ; preds = %1
%8 = load i32, i32* %2
%9 = trunc i32 %8 to i8
%10 = zext i8 %9 to i32
%11 = icmp eq i32 %10, 9
br i1 %11, label %32, label %12
12: ; preds = %7
%13 = load i32, i32* %2
%14 = trunc i32 %13 to i8
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %15, 10
br i1 %16, label %32, label %17
17: ; preds = %12
%18 = load i32, i32* %2
%19 = trunc i32 %18 to i8
%20 = zext i8 %19 to i32
%21 = icmp eq i32 %20, 13
br i1 %21, label %32, label %22
22: ; preds = %17
%23 = load i32, i32* %2
%24 = trunc i32 %23 to i8
%25 = zext i8 %24 to i32
%26 = icmp eq i32 %25, 12
br i1 %26, label %32, label %27
27: ; preds = %22
%28 = load i32, i32* %2
%29 = trunc i32 %28 to i8
%30 = zext i8 %29 to i32
%31 = icmp eq i32 %30, 11
br label %32
32: ; preds = %27, %22, %17, %12, %7, %1
%33 = phi i1 [ true, %22 ], [ true, %17 ], [ true, %12 ], [ true, %7 ], [ true, %1 ], [ %31, %27 ]
%34 = zext i1 %33 to i32
ret i32 %34
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = trunc i32 %0 to i8
switch i8 %2, label %3 [
i8 32, label %7
i8 9, label %7
i8 10, label %7
i8 13, label %7
i8 12, label %7
]
3: ; preds = %1
%4 = and i32 %0, 255
%5 = icmp eq i32 %4, 11
%6 = zext i1 %5 to i32
br label %7
7: ; preds = %1, %1, %1, %1, %1, %3
%8 = phi i32 [ 1, %1 ], [ %6, %3 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %8
}
void do_ucmath(unsigned char *x) {
  printf("%s: X before: %u\n", __func__, *x);
  *x += 5;
  printf("%s: X after: %u\n", __func__, *x);
}


x86 assembly (clang, -O0):
<do_ucmath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
lea    0xed6(%rip),%rdi
lea    0xee1(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
add    $0x5,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
lea    0xeca(%rip),%rdi
lea    0xeb9(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_ucmath>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movzbl (%rdi),%edx
lea    0xedf(%rip),%rdi
lea    0xeea(%rip),%r14
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%rbx),%al
add    $0x5,%al
mov    %al,(%rbx)
movzbl %al,%edx
lea    0xeda(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"%s: X before: %u\0A\00"
@__func__.do_ucmath = [10 x i8] c"do_ucmath\00"
@.str.1 = [17 x i8] c"%s: X after: %u\0A\00"
define void @do_ucmath(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.do_ucmath, i64 0, i64 0), i32 %5)
%7 = load i8*, i8** %2
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = add nsw i32 %9, 5
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
%12 = load i8*, i8** %2
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.do_ucmath, i64 0, i64 0), i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"%s: X before: %u\0A\00"
@__func__.do_ucmath = [10 x i8] c"do_ucmath\00"
@.str.1 = [17 x i8] c"%s: X after: %u\0A\00"
define void @do_ucmath(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = zext i8 %2 to i32
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.do_ucmath, i64 0, i64 0), i32 %3)
%5 = load i8, i8* %0
%6 = add i8 %5, 5
store i8 %6, i8* %0
%7 = zext i8 %6 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.do_ucmath, i64 0, i64 0), i32 %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("Hello world From EG1302!\n");
  printf("Name:Orlando Serrano Arzola \n");
  printf("Date Created:%d/%d/%d\n", 1, 28, 2014);
  printf("Assignment:5\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x1,%esi
mov    $0x1c,%edx
mov    $0x7de,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef0(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Hello world From EG1302!\0A\00"
@.str.1 = [30 x i8] c"Name:Orlando Serrano Arzola \0A\00"
@.str.2 = [23 x i8] c"Date Created:%d/%d/%d\0A\00"
@.str.3 = [14 x i8] c"Assignment:5\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 2014)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [23 x i8] c"Date Created:%d/%d/%d\0A\00"
@str = [25 x i8] c"Hello world From EG1302!\00"
@str.4 = [29 x i8] c"Name:Orlando Serrano Arzola \00"
@str.5 = [13 x i8] c"Assignment:5\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 28, i32 2014)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.5, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *checking_strdup(char const *);
int /*<<< orphan*/ file_exists_p(char const *);
char *unique_name_1(char const *);
char *unique_name(const char *file, unsigned char allow_passthrough) {
  if (!file_exists_p(file))
    return allow_passthrough ? (char *)file : checking_strdup(file);
  return unique_name_1(file);
}


x86 assembly (clang, -O0):
<unique_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <file_exists_p@plt>
cmp    $0x0,%eax
jne    1188 <unique_name+0x58>
movzbl -0x11(%rbp),%eax
cmp    $0x0,%eax
je     116e <unique_name+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    117b <unique_name+0x4b>
mov    -0x10(%rbp),%rdi
call   1050 <checking_strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1195 <unique_name+0x65>
mov    -0x10(%rbp),%rdi
call   1040 <unique_name_1@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unique_name>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <file_exists_p@plt>
test   %eax,%eax
je     114f <unique_name+0x1f>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <unique_name_1@plt>
test   %bpl,%bpl
je     115e <unique_name+0x2e>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <checking_strdup@plt>

LLVM IR (-O0):
define i8* @unique_name(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
%6 = load i8*, i8** %4
%7 = call i32 @file_exists_p(i8* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %20, label %9
9: ; preds = %2
%10 = load i8, i8* %5
%11 = zext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i8*, i8** %4
br label %18
15: ; preds = %9
%16 = load i8*, i8** %4
%17 = call i8* @checking_strdup(i8* %16)
br label %18
18: ; preds = %15, %13
%19 = phi i8* [ %14, %13 ], [ %17, %15 ]
store i8* %19, i8** %3
br label %23
20: ; preds = %2
%21 = load i8*, i8** %4
%22 = call i8* @unique_name_1(i8* %21)
store i8* %22, i8** %3
br label %23
23: ; preds = %20, %18
%24 = load i8*, i8** %3
ret i8* %24
}

LLVM IR (-O2):
define i8* @unique_name(i8* %0, i8 zeroext %1) {
%3 = tail call i32 @file_exists_p(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = icmp eq i8 %1, 0
br i1 %6, label %7, label %11
7: ; preds = %5
%8 = tail call i8* @checking_strdup(i8* %0)
br label %11
9: ; preds = %2
%10 = tail call i8* @unique_name_1(i8* %0)
br label %11
11: ; preds = %7, %5, %9
%12 = phi i8* [ %10, %9 ], [ %8, %7 ], [ %0, %5 ]
ret i8* %12
}
unsigned xrop3_192_1_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T & S;
  return (stk1 & (~S) & (~T)) | (D & S) | (D & T);
}


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

x86 assembly (clang, -O2):
<xrop3_192_1_1>:
mov    %edi,%eax
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_192_1_1(i8 zeroext %0, i8 zeroext %1) {
%3 = or i8 %1, %0
%4 = zext i8 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage:  sg_rdac [-a] [-f=LUN] [-v] [-V] DEVICE\n"
         "  where:\n"
         "    -a        transfer all devices to the controller\n"
         "              serving DEVICE.\n"
         "    -f=LUN    transfer the device at LUN to the\n"
         "              controller serving DEVICE\n"
         "    -v        verbose\n"
         "    -V        print version then exit\n\n"
         " Display/Modify RDAC Redundant Controller Page 0x2c.\n"
         " If [-a] or [-f] is not specified the current settings"
         " are displayed.\n");
}


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

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

LLVM IR (-O0):
@.str = [412 x i8] c"Usage: sg_rdac [-a] [-f=LUN] [-v] [-V] DEVICE\0A where:\0A -a transfer all devices to the controller\0A serving DEVICE.\0A -f=LUN transfer the device at LUN to the\0A controller serving DEVICE\0A -v verbose\0A -V print version then exit\0A\0A Display/Modify RDAC Redundant Controller Page 0x2c.\0A If [-a] or [-f] is not specified the current settings are displayed.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([412 x i8], [412 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [411 x i8] c"Usage: sg_rdac [-a] [-f=LUN] [-v] [-V] DEVICE\0A where:\0A -a transfer all devices to the controller\0A serving DEVICE.\0A -f=LUN transfer the device at LUN to the\0A controller serving DEVICE\0A -v verbose\0A -V print version then exit\0A\0A Display/Modify RDAC Redundant Controller Page 0x2c.\0A If [-a] or [-f] is not specified the current settings are displayed.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([411 x i8], [411 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ InitEditor();
int /*<<< orphan*/ OnEditOpen();
int /*<<< orphan*/ ProcessKey();
int /*<<< orphan*/ ScreenRefresh();
int /*<<< orphan*/ StartRawMode();
int main() {
  StartRawMode();
  InitEditor();
  OnEditOpen();
  while (1) {
    ScreenRefresh();
    ProcessKey();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <StartRawMode@plt>
mov    $0x0,%al
call   1030 <InitEditor@plt>
mov    $0x0,%al
call   1060 <OnEditOpen@plt>
mov    $0x0,%al
call   1040 <ScreenRefresh@plt>
mov    $0x0,%al
call   1050 <ProcessKey@plt>
jmp    1174 <main+0x24>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <StartRawMode@plt>
xor    %eax,%eax
call   1030 <InitEditor@plt>
xor    %eax,%eax
call   1060 <OnEditOpen@plt>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <ScreenRefresh@plt>
xor    %eax,%eax
call   1050 <ProcessKey@plt>
jmp    1170 <main+0x20>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @StartRawMode()
%3 = call i32 (...) @InitEditor()
%4 = call i32 (...) @OnEditOpen()
br label %5
5: ; preds = %0, %5
%6 = call i32 (...) @ScreenRefresh()
%7 = call i32 (...) @ProcessKey()
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @StartRawMode()
%2 = tail call i32 (...) @InitEditor()
%3 = tail call i32 (...) @OnEditOpen()
br label %4
4: ; preds = %0, %4
%5 = tail call i32 (...) @ScreenRefresh()
%6 = tail call i32 (...) @ProcessKey()
br label %4
}
int my_strlen(char *s) {
  char *p = s;
  while (*p)
    p++;
  return (p - s);
}


x86 assembly (clang, -O0):
<my_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     112e <my_strlen+0x2e>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <my_strlen+0x10>
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <my_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @my_strlen(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 0
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
%8 = ptrtoint i8* %3 to i64
%9 = ptrtoint i8* %0 to i64
%10 = sub i64 %8, %9
%11 = trunc i64 %10 to i32
ret i32 %11
}
void CallMe(void (*func)(int), int arg) { func(arg); }


x86 assembly (clang, -O0):
<CallMe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%edi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CallMe>:
mov    %rdi,%rax
mov    %esi,%edi
jmp    *%rax

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

LLVM IR (-O2):
define void @CallMe(void (i32)* nocapture %0, i32 %1) {
tail call void %0(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int listen(int, int);
int /*<<< orphan*/ perror(char *);
void xlisten(int sockfd, int backlog) {
  int x;
  x = listen(sockfd, backlog);
  if (x != 0) {
    perror("listen");
    exit(EXIT_FAILURE);
  } else {
    return;
  }
}


x86 assembly (clang, -O0):
<xlisten>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <listen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1170 <xlisten+0x40>
lea    0xea3(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xlisten>:
push   %rax
call   1030 <listen@plt>
test   %eax,%eax
jne    113c <xlisten+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"listen\00"
@EXIT_FAILURE = global i32 0
define void @xlisten(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 = call i32 @listen(i32 %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %15
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"listen\00"
@EXIT_FAILURE = global i32 0
define void @xlisten(i32 %0, i32 %1) {
%3 = tail call i32 @listen(i32 %0, i32 %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
void I420ToRGB565() {}


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

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

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

LLVM IR (-O2):
define void @I420ToRGB565() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int32_t;

/* Variables and functions */
int32_t ev3_lcd_draw_string(const char *buf, int32_t x, int32_t y) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ev3_lcd_draw_string(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int cmTestFunc();
int /*<<< orphan*/ printf(char *);
int main(void) {
  if (cmTestFunc() > 4200) {
    printf("Test success.\n");
    return 0;
  } else {
    printf("Test failure.\n");
    return 1;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <cmTestFunc@plt>
cmp    $0x1068,%eax
jle    1159 <main+0x39>
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    116c <main+0x4c>
lea    0xeaf(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <cmTestFunc@plt>
xor    %ebx,%ebx
cmp    $0x1069,%eax
setl   %bl
lea    0xed5(%rip),%rax
lea    0xec0(%rip),%rdi
cmovge %rax,%rdi
call   1040 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Test success.\0A\00"
@.str.1 = [15 x i8] c"Test failure.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @cmTestFunc()
%3 = icmp sgt i32 %2, 4200
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %8
6: ; preds = %0
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@str = [14 x i8] c"Test failure.\00"
@str.2 = [14 x i8] c"Test success.\00"
define i32 @main() {
%1 = tail call i32 (...) @cmTestFunc()
%2 = icmp sgt i32 %1, 4200
%3 = select i1 %2, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0)
%4 = xor i1 %2, true
%5 = zext i1 %4 to i32
%6 = tail call i32 @puts(i8* dereferenceable(1) %3)
ret i32 %5
}
/* Variables and functions */
int log(int);
float get_T(double fst) { return -1 * log(1. - fst); }


x86 assembly (clang, -O0):
<get_T>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
imul   $0xffffffff,%eax,%eax
cvtsi2ss %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_T>:
push   %rax
movsd  0xee7(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <log@plt>
neg    %eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @get_T(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double 1.000000e+00, %3
%5 = fptosi double %4 to i32
%6 = call i32 @log(i32 %5)
%7 = mul nsw i32 -1, %6
%8 = sitofp i32 %7 to float
ret float %8
}

LLVM IR (-O2):
define float @get_T(double %0) {
%2 = fsub double 1.000000e+00, %0
%3 = fptosi double %2 to i32
%4 = tail call i32 @log(i32 %3)
%5 = sub nsw i32 0, %4
%6 = sitofp i32 %5 to float
ret float %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ test_abs();
int /*<<< orphan*/ test_labs();
int /*<<< orphan*/ test_ldiv();
int /*<<< orphan*/ test_llabs();
int /*<<< orphan*/ test_lldiv();
void run_stdlib_tests() {
  printf("\nRunning Test Case: %s\n", "Test POSIX stdlib.h functions");
  ;
  test_abs();
  test_labs();
  test_llabs();
  test_ldiv();
  test_lldiv();
}


x86 assembly (clang, -O0):
<run_stdlib_tests>:
push   %rbp
mov    %rsp,%rbp
lea    0xe95(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1070 <printf@plt>
mov    $0x0,%al
call   1080 <test_abs@plt>
mov    $0x0,%al
call   1050 <test_labs@plt>
mov    $0x0,%al
call   1040 <test_llabs@plt>
mov    $0x0,%al
call   1030 <test_ldiv@plt>
mov    $0x0,%al
call   1060 <test_lldiv@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<run_stdlib_tests>:
push   %rax
lea    0xe98(%rip),%rdi
lea    0xea9(%rip),%rsi
call   1070 <printf@plt>
xor    %eax,%eax
call   1080 <test_abs@plt>
xor    %eax,%eax
call   1050 <test_labs@plt>
xor    %eax,%eax
call   1040 <test_llabs@plt>
xor    %eax,%eax
call   1030 <test_ldiv@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <test_lldiv@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"\0ARunning Test Case: %s\0A\00"
@.str.1 = [30 x i8] c"Test POSIX stdlib.h functions\00"
define void @run_stdlib_tests() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @test_abs()
%3 = call i32 (...) @test_labs()
%4 = call i32 (...) @test_llabs()
%5 = call i32 (...) @test_ldiv()
%6 = call i32 (...) @test_lldiv()
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"\0ARunning Test Case: %s\0A\00"
@.str.1 = [30 x i8] c"Test POSIX stdlib.h functions\00"
define void @run_stdlib_tests() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @test_abs()
%3 = tail call i32 (...) @test_labs()
%4 = tail call i32 (...) @test_llabs()
%5 = tail call i32 (...) @test_ldiv()
%6 = tail call i32 (...) @test_lldiv()
ret void
}
int main(void) {
  int a = 0;
  int *b = a;
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 0, i32* %1
store i32 0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store i32* %6, i32** %3
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int write(int, int *, int);
int net_putc(int fd, int c) {
  int r;
  r = write(fd, &c, 1);
  if (r == 0)
    return (-1);
  else
    return (c);
}


x86 assembly (clang, -O0):
<net_putc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1148 <net_putc+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    114e <net_putc+0x3e>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<net_putc>:
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %esi,0xc(%rsp)
lea    0xc(%rsp),%rsi
mov    $0x1,%edx
call   1030 <write@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
or     %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @net_putc(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = call i32 @write(i32 %0, i32* %3, i32 1)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -1, i32 %1
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ FlightPlanStatusHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void FlightPlanStatusRequestUpdate() {
  UAVObjRequestUpdate(FlightPlanStatusHandle());
}


x86 assembly (clang, -O0):
<FlightPlanStatusRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <FlightPlanStatusHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlightPlanStatusRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <FlightPlanStatusHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @FlightPlanStatusRequestUpdate() {
%1 = call i32 (...) @FlightPlanStatusHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightPlanStatusRequestUpdate() {
%1 = tail call i32 (...) @FlightPlanStatusHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_STORE_CTX;

/* Variables and functions */
int verify_accept_cb(X509_STORE_CTX *ctx, void *arg) { return 1; }


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @_Locale_monetary_destroy(i8* nocapture %0) {
ret void
}
void substitute(char *str, int ch1, int ch2) {
  for (; *str; str++) {
    if (*str == ch1) {
      *str = ch2;
    }
  }
}


x86 assembly (clang, -O0):
<substitute>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     114c <substitute+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1136 <substitute+0x36>
mov    -0x10(%rbp),%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
jmp    113b <substitute+0x3b>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110e <substitute+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<substitute>:
mov    (%rdi),%al
test   %al,%al
je     1127 <substitute+0x27>
add    $0x1,%rdi
jmp    111b <substitute+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1127 <substitute+0x27>
movsbl %al,%eax
cmp    %esi,%eax
jne    1110 <substitute+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <substitute+0x10>
ret

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

LLVM IR (-O2):
define void @substitute(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %3
%7 = trunc i32 %2 to i8
br label %8
8: ; preds = %6, %14
%9 = phi i8 [ %4, %6 ], [ %16, %14 ]
%10 = phi i8* [ %0, %6 ], [ %15, %14 ]
%11 = sext i8 %9 to i32
%12 = icmp eq i32 %11, %1
br i1 %12, label %13, label %14
13: ; preds = %8
store i8 %7, i8* %10
br label %14
14: ; preds = %8, %13
%15 = getelementptr inbounds i8, i8* %10, i64 1
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %14, %3
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t _nibble_to_hex_char(uint8_t nibble) {
  if (nibble > 15)
    return (uint8_t)0;
  return (uint8_t)nibble + (nibble < 10 ? 48 : 87);
}


x86 assembly (clang, -O0):
<_nibble_to_hex_char>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xf,-0x8(%rbp)
jle    111d <_nibble_to_hex_char+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1138 <_nibble_to_hex_char+0x38>
mov    -0x8(%rbp),%eax
mov    -0x8(%rbp),%esi
mov    $0x57,%ecx
mov    $0x30,%edx
cmp    $0xa,%esi
cmovl  %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_nibble_to_hex_char>:
lea    0x57(%rdi),%eax
lea    0x30(%rdi),%ecx
cmp    $0xa,%edi
cmovge %eax,%ecx
xor    %eax,%eax
cmp    $0x10,%edi
cmovl  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_nibble_to_hex_char(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sgt i32 %4, 15
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %14
7: ; preds = %1
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 10
%11 = zext i1 %10 to i64
%12 = select i1 %10, i32 48, i32 87
%13 = add nsw i32 %8, %12
store i32 %13, i32* %2
br label %14
14: ; preds = %7, %6
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @_nibble_to_hex_char(i32 %0) {
%2 = icmp sgt i32 %0, 15
%3 = icmp slt i32 %0, 10
%4 = select i1 %3, i32 48, i32 87
%5 = add nsw i32 %4, %0
%6 = select i1 %2, i32 0, i32 %5
ret i32 %6
}
void busy_wait(int n) {
  int i, j;
  static volatile int k = 0;
  for (i = 0; i < n; i++)
    for (j = 0; j < 100000; j++)
      k++;
}


x86 assembly (clang, -O0):
<busy_wait>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    115e <busy_wait+0x5e>
movl   $0x0,-0xc(%rbp)
cmpl   $0x186a0,-0xc(%rbp)
jge    114b <busy_wait+0x4b>
mov    0x2ef0(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ee7(%rip)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1121 <busy_wait+0x21>
jmp    1150 <busy_wait+0x50>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <busy_wait+0xe>
pop    %rbp
ret

x86 assembly (clang, -O2):
<busy_wait>:
test   %edi,%edi
jle    114f <busy_wait+0x4f>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
mov    $0x186a0,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
addl   $0x1,0x2efd(%rip)
addl   $0x1,0x2ef6(%rip)
addl   $0x1,0x2eef(%rip)
addl   $0x1,0x2ee8(%rip)
addl   $0x1,0x2ee1(%rip)
add    $0xfffffffb,%ecx
jne    1120 <busy_wait+0x20>
add    $0x1,%eax
cmp    %edi,%eax
jne    1110 <busy_wait+0x10>
ret

LLVM IR (-O0):
@busy_wait.k = internal global i32 0
define void @busy_wait(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %5
5: ; preds = %20, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %23
9: ; preds = %5
store i32 0, i32* %4
br label %10
10: ; preds = %16, %9
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 100000
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = load volatile i32, i32* @busy_wait.k
%15 = add nsw i32 %14, 1
store volatile i32 %15, i32* @busy_wait.k
br label %16
16: ; preds = %13
%17 = load i32, i32* %4
%18 = add nsw i32 %17, 1
store i32 %18, i32* %4
br label %10
19: ; preds = %10
br label %20
20: ; preds = %19
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %5
23: ; preds = %5
ret void
}

LLVM IR (-O2):
@busy_wait.k = internal global i32 0
define void @busy_wait(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %22
3: ; preds = %1, %19
%4 = phi i32 [ %20, %19 ], [ 0, %1 ]
br label %5
5: ; preds = %5, %3
%6 = phi i32 [ 0, %3 ], [ %17, %5 ]
%7 = load volatile i32, i32* @busy_wait.k
%8 = add nsw i32 %7, 1
store volatile i32 %8, i32* @busy_wait.k
%9 = load volatile i32, i32* @busy_wait.k
%10 = add nsw i32 %9, 1
store volatile i32 %10, i32* @busy_wait.k
%11 = load volatile i32, i32* @busy_wait.k
%12 = add nsw i32 %11, 1
store volatile i32 %12, i32* @busy_wait.k
%13 = load volatile i32, i32* @busy_wait.k
%14 = add nsw i32 %13, 1
store volatile i32 %14, i32* @busy_wait.k
%15 = load volatile i32, i32* @busy_wait.k
%16 = add nsw i32 %15, 1
store volatile i32 %16, i32* @busy_wait.k
%17 = add nuw nsw i32 %6, 5
%18 = icmp eq i32 %17, 100000
br i1 %18, label %19, label %5
19: ; preds = %5
%20 = add nuw nsw i32 %4, 1
%21 = icmp eq i32 %20, %0
br i1 %21, label %22, label %3
22: ; preds = %19, %1
ret void
}
int xmlFileMatch(const char *filename __attribute__((unused))) { return (1); }


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

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

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

LLVM IR (-O2):
define i32 @xmlFileMatch(i8* nocapture readnone %0) {
ret i32 1
}
unsigned long PairArg(x)
unsigned short *x;
{ return ((*x) << 16 | x[1]); }


x86 assembly (clang, -O0):
<PairArg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
shl    $0x10,%eax
mov    -0x8(%rbp),%rcx
movzwl 0x2(%rcx),%ecx
or     %ecx,%eax
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<PairArg>:
movzwl (%rdi),%eax
shl    $0x10,%eax
movzwl 0x2(%rdi),%ecx
cltq
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @PairArg(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = shl i32 %5, 16
%7 = load i16*, i16** %2
%8 = getelementptr inbounds i16, i16* %7, i64 1
%9 = load i16, i16* %8
%10 = zext i16 %9 to i32
%11 = or i32 %6, %10
%12 = sext i32 %11 to i64
ret i64 %12
}

LLVM IR (-O2):
define i64 @PairArg(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = zext i16 %2 to i32
%4 = shl nuw i32 %3, 16
%5 = getelementptr inbounds i16, i16* %0, i64 1
%6 = load i16, i16* %5
%7 = zext i16 %6 to i32
%8 = or i32 %4, %7
%9 = sext i32 %8 to i64
ret i64 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
void write8(void *addr, uint8_t val) { *(volatile uint8_t *)addr = val; }


x86 assembly (clang, -O0):
<write8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @write8(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store volatile i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @write8(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store volatile i32 %1, i32* %3
ret void
}
/* Variables and functions */
int abs(int);
int decimal_string_length(int i) {
  int length = 1;
  if (i <= 0) {
    length++;
  }
  int current = abs(i);
  while (current > 0) {
    current /= 10;
    length++;
  }
  return length;
}


x86 assembly (clang, -O0):
<decimal_string_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1135 <decimal_string_length+0x25>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    1166 <decimal_string_length+0x56>
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1140 <decimal_string_length+0x30>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimal_string_length>:
xor    %eax,%eax
test   %edi,%edi
setle  %al
add    $0x1,%eax
test   %edi,%edi
je     1134 <decimal_string_length+0x34>
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
mov    $0xcccccccd,%edx
nopw   0x0(%rax,%rax,1)
mov    %ecx,%esi
imul   %rdx,%rsi
shr    $0x23,%rsi
add    $0x1,%eax
cmp    $0x9,%ecx
mov    %esi,%ecx
ja     1120 <decimal_string_length+0x20>
ret

LLVM IR (-O0):
define i32 @decimal_string_length(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %3
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
store i32 %9, i32* %3
br label %10
10: ; preds = %7, %1
%11 = load i32, i32* %2
%12 = call i32 @abs(i32 %11)
store i32 %12, i32* %4
br label %13
13: ; preds = %16, %10
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %4
%18 = sdiv i32 %17, 10
store i32 %18, i32* %4
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %13
21: ; preds = %13
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @decimal_string_length(i32 %0) {
%2 = icmp slt i32 %0, 1
%3 = select i1 %2, i32 2, i32 1
%4 = icmp eq i32 %0, 0
br i1 %4, label %13, label %5
5: ; preds = %1
%6 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ %10, %7 ], [ %6, %5 ]
%9 = phi i32 [ %11, %7 ], [ %3, %5 ]
%10 = udiv i32 %8, 10
%11 = add nuw nsw i32 %9, 1
%12 = icmp ult i32 %8, 10
br i1 %12, label %13, label %7
13: ; preds = %7, %1
%14 = phi i32 [ %3, %1 ], [ %11, %7 ]
ret i32 %14
}