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

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *);
int /*<<< orphan*/ vfprintf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/);
void vfprintf_color(FILE *file, char *color, char *format, va_list args) {
  fprintf(file, "%s", color);
  vfprintf(file, format, args);
  fprintf(file, "%s", "\033[01;37m");
}


x86 assembly (clang, -O0):
<vfprintf_color>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <vfprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xe9a(%rip),%rsi
lea    0xe96(%rip),%rdx
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfprintf_color>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rdi,%rbp
mov    %rsi,%rdi
mov    %rbp,%rsi
call   1030 <fputs@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1040 <vfprintf@plt>
lea    0xea3(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
mov    %rbp,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <fwrite@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [9 x i8] c"\1B[01;37m\00"
define void @vfprintf_color(i32* %0, i8* %1, i8* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = load i8*, i8** %6
%11 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = load i32*, i32** %5
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = call i32 @vfprintf(i32* %12, i8* %13, i32 %14)
%16 = load i32*, i32** %5
%17 = call i32 @fprintf(i32* %16, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"\1B[01;37m\00"
define void @vfprintf_color(i32* nocapture %0, i8* nocapture %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @fputs(i8* %1, i32* %0)
%6 = tail call i32 @vfprintf(i32* %0, i8* %2, i32 %3)
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i64 8, i64 1, i32* %0)
ret void
}
void WideTimer3A_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<WideTimer3A_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <WideTimer3A_Handler+0x9>
jmp    1109 <WideTimer3A_Handler+0x9>

x86 assembly (clang, -O2):
<WideTimer3A_Handler>:
jmp    1100 <WideTimer3A_Handler>

LLVM IR (-O0):
define void @WideTimer3A_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @WideTimer3A_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char *, int);
void swap_lines(char *r1, char *r2) {
  char tmpradek[(100 + 10 + 1 + 16 + 1)];
  memcpy(tmpradek, r1, (100 + 10 + 1 + 16 + 1));
  memcpy(r1, r2, (100 + 10 + 1 + 16 + 1));
  memcpy(r2, tmpradek, (100 + 10 + 1 + 16 + 1));
}


x86 assembly (clang, -O0):
<swap_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap_lines>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    $0x80,%edx
call   1030 <memcpy@plt>
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @swap_lines(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [128 x i8]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = call i32 @memcpy(i8* %6, i8* %7, i32 128)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @memcpy(i8* %9, i8* %10, i32 128)
%12 = load i8*, i8** %4
%13 = getelementptr inbounds [128 x i8], [128 x i8]* %5, i64 0, i64 0
%14 = call i32 @memcpy(i8* %12, i8* %13, i32 128)
ret void
}

LLVM IR (-O2):
define void @swap_lines(i8* %0, i8* %1) {
%3 = alloca [128 x i8]
%4 = getelementptr inbounds [128 x i8], [128 x i8]* %3, i64 0, i64 0
%5 = call i32 @memcpy(i8* %4, i8* %0, i32 128)
%6 = call i32 @memcpy(i8* %0, i8* %1, i32 128)
%7 = call i32 @memcpy(i8* %1, i8* %4, i32 128)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", 108608662);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 108608662)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
char tolower(unsigned char);
char *lowercase(char *str) {
  char *r = str;
  assert(str != NULL);
  while (tolower((unsigned char)*str) != '\0')
    str++;
  return r;
}


x86 assembly (clang, -O0):
<lowercase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edi
call   1040 <tolower@plt>
movsbl %al,%eax
cmp    $0x0,%eax
je     116f <lowercase+0x4f>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1146 <lowercase+0x26>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lowercase>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
mov    %r14,%rbx
nopl   0x0(%rax,%rax,1)
movzbl (%rbx),%edi
call   1040 <tolower@plt>
add    $0x1,%rbx
test   %al,%al
jne    1140 <lowercase+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @lowercase(i8* returned %0) {
%2 = icmp ne i8* %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
br label %5
5: ; preds = %5, %1
%6 = phi i8* [ %0, %1 ], [ %10, %5 ]
%7 = load i8, i8* %6
%8 = tail call signext i8 @tolower(i8 zeroext %7)
%9 = icmp eq i8 %8, 0
%10 = getelementptr inbounds i8, i8* %6, i64 1
br i1 %9, label %11, label %5
11: ; preds = %5
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ PrintForces(int *, char *);
int main() {
  int forces[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  PrintForces(forces, "Naalu");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x24,%edx
call   1040 <memcpy@plt>
lea    -0x30(%rbp),%rdi
lea    0xedc(%rip),%rsi
call   1030 <PrintForces@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf06(%rip),%eax
mov    %eax,0x20(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee8(%rip),%rsi
mov    %rsp,%rdi
call   1030 <PrintForces@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.forces = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@.str = [6 x i8] c"Naalu\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @PrintForces(i32* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@__const.main.forces = [9 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9]
@.str = [6 x i8] c"Naalu\00"
define i32 @main() {
%1 = alloca [9 x i32]
%2 = bitcast [9 x i32]* %1 to i8*
%3 = getelementptr inbounds [9 x i32], [9 x i32]* %1, i64 0, i64 0
%4 = call i32 @PrintForces(i32* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
void rop3_98_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T | *D;
  stk2 = S & stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_98_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @rop3_98_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void nautywrapper_aut_generators(int isdir, int n, int *adj, FILE *f) {}


x86 assembly (clang, -O0):
<nautywrapper_aut_generators>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @nautywrapper_aut_generators(i32 %0, i32 %1, i32* nocapture %2, i32* nocapture %3) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ RAND_seed(void *, int);
void esock_ssl_seed(void *buf, int len) { RAND_seed(buf, len); }


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

x86 assembly (clang, -O2):
<esock_ssl_seed>:
jmp    1030 <RAND_seed@plt>

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

LLVM IR (-O2):
define void @esock_ssl_seed(i8* %0, i32 %1) {
%3 = tail call i32 @RAND_seed(i8* %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int, int);
int /*<<< orphan*/ system(char *);
void Rotate(int rotatecmd, int rotatespd) {
  char cmdstr[256];
  sprintf(cmdstr, "setrotate %d %d  1>/dev/null 2>/dev/null", rotatecmd,
          rotatespd);
  system(cmdstr);
}


x86 assembly (clang, -O0):
<Rotate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
lea    0xebb(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rotate>:
push   %rbx
sub    $0x100,%rsp
mov    %esi,%ecx
mov    %edi,%edx
lea    0xecd(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"setrotate %d %d 1>/dev/null 2>/dev/null\00"
define void @Rotate(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [256 x i8]
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %8)
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = call i32 @system(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"setrotate %d %d 1>/dev/null 2>/dev/null\00"
define void @Rotate(i32 %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
%6 = call i32 @system(i8* %4)
ret void
}
int outbyte(char c) { return 0; }


x86 assembly (clang, -O0):
<outbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @outbyte(i8 signext %0) {
ret i32 0
}
refresh() {}


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

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

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

LLVM IR (-O2):
define i32 @refresh() {
ret i32 undef
}
void rot(int n, int *x, int *y, int rx, int ry) {
  if (ry == 0) {
    if (rx == 1) {
      *x = n - 1 - *x;
      *y = n - 1 - *y;
    }
    int t = *x;
    *x = *y;
    *y = t;
  }
}


x86 assembly (clang, -O0):
<rot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    116c <rot+0x6c>
cmpl   $0x1,-0x1c(%rbp)
jne    114e <rot+0x4e>
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
sub    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
sub    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x24(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rot>:
test   %r8d,%r8d
je     1106 <rot+0x6>
ret
cmp    $0x1,%ecx
jne    111a <rot+0x1a>
add    $0xffffffff,%edi
mov    %edi,%eax
sub    (%rsi),%eax
mov    %eax,(%rsi)
sub    (%rdx),%edi
mov    %edi,(%rdx)
jmp    111c <rot+0x1c>
mov    (%rdx),%edi
mov    (%rsi),%eax
mov    %edi,(%rsi)
mov    %eax,(%rdx)
ret

LLVM IR (-O0):
define void @rot(i32 %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32, i32* %10
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %38
14: ; preds = %5
%15 = load i32, i32* %9
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %30
17: ; preds = %14
%18 = load i32, i32* %6
%19 = sub nsw i32 %18, 1
%20 = load i32*, i32** %7
%21 = load i32, i32* %20
%22 = sub nsw i32 %19, %21
%23 = load i32*, i32** %7
store i32 %22, i32* %23
%24 = load i32, i32* %6
%25 = sub nsw i32 %24, 1
%26 = load i32*, i32** %8
%27 = load i32, i32* %26
%28 = sub nsw i32 %25, %27
%29 = load i32*, i32** %8
store i32 %28, i32* %29
br label %30
30: ; preds = %17, %14
%31 = load i32*, i32** %7
%32 = load i32, i32* %31
store i32 %32, i32* %11
%33 = load i32*, i32** %8
%34 = load i32, i32* %33
%35 = load i32*, i32** %7
store i32 %34, i32* %35
%36 = load i32, i32* %11
%37 = load i32*, i32** %8
store i32 %36, i32* %37
br label %38
38: ; preds = %30, %5
ret void
}

LLVM IR (-O2):
define void @rot(i32 %0, i32* nocapture %1, i32* nocapture %2, i32 %3, i32 %4) {
%6 = icmp eq i32 %4, 0
br i1 %6, label %7, label %20
7: ; preds = %5
%8 = icmp eq i32 %3, 1
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = load i32, i32* %2
br label %17
11: ; preds = %7
%12 = add nsw i32 %0, -1
%13 = load i32, i32* %1
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %1
%15 = load i32, i32* %2
%16 = sub nsw i32 %12, %15
store i32 %16, i32* %2
br label %17
17: ; preds = %9, %11
%18 = phi i32 [ %10, %9 ], [ %16, %11 ]
%19 = load i32, i32* %1
store i32 %18, i32* %1
store i32 %19, i32* %2
br label %20
20: ; preds = %17, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void fatalError(const char *message) {
  printf("[x]fatal: %s\n", message);
  exit(1);
}


x86 assembly (clang, -O0):
<fatalError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatalError>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"[x]fatal: %s\0A\00"
define void @fatalError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [14 x i8] c"[x]fatal: %s\0A\00"
define void @fatalError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
int test_imm_07uint64_highword_reg(unsigned long long val) {
  return ((val >> 32) & (0x07 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_07uint64_highword_reg>:
movabs $0x700000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_07uint64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = lshr i64 %3, 32
%5 = and i64 %4, 7
%6 = icmp ne i64 %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_07uint64_highword_reg(i64 %0) {
%2 = and i64 %0, 30064771072
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int get_seq_diff(int n1, int n2) {
  if (n1 > n2) {
    n2 = n2 + 1000;
  }
  return n2 - n1;
}


x86 assembly (clang, -O0):
<get_seq_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <get_seq_diff+0x21>
mov    -0x8(%rbp),%eax
add    $0x3e8,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_seq_diff>:
lea    0x3e8(%rsi),%eax
cmp    %esi,%edi
cmovle %esi,%eax
sub    %edi,%eax
ret

LLVM IR (-O0):
define i32 @get_seq_diff(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* %4
%10 = add nsw i32 %9, 1000
store i32 %10, i32* %4
br label %11
11: ; preds = %8, %2
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = sub nsw i32 %12, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @get_seq_diff(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = add nsw i32 %1, 1000
%5 = select i1 %3, i32 %4, i32 %1
%6 = sub nsw i32 %5, %0
ret i32 %6
}
/* Variables and functions */
bool nrf51_errata_53(void) { return false; }


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

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

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

LLVM IR (-O2):
define i32 @nrf51_errata_53() {
ret i32 0
}
char *get_trace() { return ""; }


x86 assembly (clang, -O0):
<get_trace>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_trace>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @get_trace() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @get_trace() {
ret i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ pk();
int main() {
  pk();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pk()
ret i32 0
}
void set_eflags(unsigned long eflags) {
  __builtin_ia32_writeeflags_u64(eflags);
}


x86 assembly (clang, -O0):
<set_eflags>:
push   %rbp
mov    %rsp,%rbp
push   %rax
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
push   %rax
popf
add    $0x8,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_eflags>:
push   %rdi
popf
ret

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

LLVM IR (-O2):
define void @set_eflags(i64 %0) {
tail call void @llvm.x86.flags.write.u64(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
int main(int argc, char *argv[]) {
  for (int i = 0; i < argc; i++) {
    printf("argv[%d] = %s\n", i, argv[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1162 <main+0x52>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %edi,%edi
jle    1147 <main+0x37>
mov    %rsi,%r14
mov    %edi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"argv[%d] = %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %7
7: ; preds = %19, %2
%8 = load i32, i32* %6
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %22
11: ; preds = %7
%12 = load i32, i32* %6
%13 = load i8**, i8*** %5
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8*, i8** %13, i64 %15
%17 = load i8*, i8** %16
%18 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %12, i8* %17)
br label %19
19: ; preds = %11
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
br label %7
22: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"argv[%d] = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %7
6: ; preds = %7, %2
ret i32 0
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %13, %7 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %8
%10 = load i8*, i8** %9
%11 = trunc i64 %8 to i32
%12 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %10)
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %7
}
int seg_reg_usable(int access_rights) { return !(access_rights & (1 << 16)); }


x86 assembly (clang, -O0):
<seg_reg_usable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x10000,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seg_reg_usable>:
xor    %eax,%eax
test   $0x10000,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @seg_reg_usable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65536
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @seg_reg_usable(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 1
%4 = xor i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ driveForward(int, int);
void driveBackward(int millis, int speed) { driveForward(millis, -speed); }


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

x86 assembly (clang, -O2):
<driveBackward>:
neg    %esi
jmp    1030 <driveForward@plt>

LLVM IR (-O0):
define void @driveBackward(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 0, %6
%8 = call i32 @driveForward(i32 %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @driveBackward(i32 %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = tail call i32 @driveForward(i32 %0, i32 %3)
ret void
}
/* Variables and functions */
double quagev_(double *, double *);
double cquagev(double *f, double *para) { return quagev_(f, para); }


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

x86 assembly (clang, -O2):
<cquagev>:
jmp    1030 <quagev_@plt>

LLVM IR (-O0):
define double @cquagev(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call double @quagev_(double* %5, double* %6)
ret double %7
}

LLVM IR (-O2):
define double @cquagev(double* %0, double* %1) {
%3 = tail call double @quagev_(double* %0, double* %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ _Error(long, char *);
void Error_PrefixSyntaxMustFinishWithExpression(long p_position) {
  _Error(p_position, "Prefix syntax must finish with an expression");
}


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

x86 assembly (clang, -O2):
<Error_PrefixSyntaxMustFinishWithExpression>:
lea    0xee9(%rip),%rsi
jmp    1030 <_Error@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Prefix syntax must finish with an expression\00"
define void @Error_PrefixSyntaxMustFinishWithExpression(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @_Error(i64 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [45 x i8] c"Prefix syntax must finish with an expression\00"
define void @Error_PrefixSyntaxMustFinishWithExpression(i64 %0) {
%2 = tail call i32 @_Error(i64 %0, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int int8_t;

/* Variables and functions */
int8_t nrf_802154_dbm_from_energy_level_calculate(uint8_t energy_level) {
  return (-94) + (energy_level / 4);
}


x86 assembly (clang, -O0):
<nrf_802154_dbm_from_energy_level_calculate>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
add    $0xffffffa2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nrf_802154_dbm_from_energy_level_calculate>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
sar    $0x2,%eax
add    $0xffffffa2,%eax
ret

LLVM IR (-O0):
define i32 @nrf_802154_dbm_from_energy_level_calculate(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 4
%5 = add nsw i32 -94, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @nrf_802154_dbm_from_energy_level_calculate(i32 %0) {
%2 = sdiv i32 %0, 4
%3 = add nsw i32 %2, -94
ret i32 %3
}
char *strcat(char *a, const char *b) {
  char *result = a;
  while (*a)
    a++;
  while (*a++ = *b++)
    ;
  return result;
}


x86 assembly (clang, -O0):
<strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcat+0x14>
jmp    1137 <strcat+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1166 <strcat+0x66>
jmp    1137 <strcat+0x37>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x0,(%rcx)
lea    0x1(%rcx),%rcx
jne    1110 <strcat+0x10>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rdx,1),%edi
mov    %dil,-0x1(%rcx,%rdx,1)
add    $0x1,%rdx
test   %dil,%dil
jne    1120 <strcat+0x20>
ret

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

LLVM IR (-O2):
define i8* @strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %11, %8 ], [ %1, %3 ]
%10 = phi i8* [ %13, %8 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %9, i64 1
%12 = load i8, i8* %9
%13 = getelementptr inbounds i8, i8* %10, i64 1
store i8 %12, i8* %10
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret i8* %0
}
void test_three(int x, int y) {
#pragma omp target teams distribute parallel for simd collapse(1)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_three>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_three+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_three+0x43>
jmp    1135 <test_three+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_three+0x24>
jmp    1148 <test_three+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_three+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @test_three(i32 %0, i32 %1) {
ret void
}
test1() { int foo2, *(*(*bar)(int))(float), *baz(double); }


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

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

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

LLVM IR (-O2):
define i32 @test1() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ PRIO_PROCESS;
int fork();
int getpriority(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int);
void main(void) {
  int pid;
  pid = fork();
  printf("PID : %d PRIO : %d\n", pid, getpriority(PRIO_PROCESS, 0));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <fork@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <getpriority@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xe9c(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <fork@plt>
mov    %eax,%ebx
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
call   1030 <getpriority@plt>
lea    0xeaf(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [20 x i8] c"PID : %d PRIO : %d\0A\00"
@PRIO_PROCESS = global i32 0
define void @main() {
%1 = tail call i32 (...) @fork()
%2 = load i32, i32* @PRIO_PROCESS
%3 = tail call i32 @getpriority(i32 %2, i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %3)
ret void
}
int HelpItem60(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem60() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int dummy_choose_action(const char *a) {
  printf("skin wants action: %s\n", a);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"skin wants action: %s\0A\00"
define i32 @dummy_choose_action(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"skin wants action: %s\0A\00"
define i32 @dummy_choose_action(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LCD_putChar(unsigned char);
unsigned char decimalToBCD(unsigned char);
void LCDPrintNumero(unsigned char numero) {
  numero = decimalToBCD(numero);
  LCD_putChar((numero >> 4) + 48);
  LCD_putChar((numero & 0x0F) + 48);
}


x86 assembly (clang, -O0):
<LCDPrintNumero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edi
call   1030 <decimalToBCD@plt>
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
add    $0x30,%eax
movzbl %al,%edi
call   1040 <LCD_putChar@plt>
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
add    $0x30,%eax
movzbl %al,%edi
call   1040 <LCD_putChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDPrintNumero>:
push   %rbx
call   1030 <decimalToBCD@plt>
mov    %eax,%ebx
shr    $0x4,%al
or     $0x30,%al
movzbl %al,%edi
call   1040 <LCD_putChar@plt>
and    $0xf,%bl
or     $0x30,%bl
movzbl %bl,%edi
pop    %rbx
jmp    1040 <LCD_putChar@plt>

LLVM IR (-O0):
define void @LCDPrintNumero(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call zeroext i8 @decimalToBCD(i8 zeroext %3)
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = zext i8 %5 to i32
%7 = ashr i32 %6, 4
%8 = add nsw i32 %7, 48
%9 = trunc i32 %8 to i8
%10 = call i32 @LCD_putChar(i8 zeroext %9)
%11 = load i8, i8* %2
%12 = zext i8 %11 to i32
%13 = and i32 %12, 15
%14 = add nsw i32 %13, 48
%15 = trunc i32 %14 to i8
%16 = call i32 @LCD_putChar(i8 zeroext %15)
ret void
}

LLVM IR (-O2):
define void @LCDPrintNumero(i8 zeroext %0) {
%2 = tail call zeroext i8 @decimalToBCD(i8 zeroext %0)
%3 = lshr i8 %2, 4
%4 = or i8 %3, 48
%5 = tail call i32 @LCD_putChar(i8 zeroext %4)
%6 = and i8 %2, 15
%7 = or i8 %6, 48
%8 = tail call i32 @LCD_putChar(i8 zeroext %7)
ret void
}
float isValidTriangle(float a, float b, float c) {
  if ((a + b) < c)
    return 0;
  if ((a + c) < b)
    return 0;
  if ((b + c) < a)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<isValidTriangle>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm1
addss  -0xc(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1138 <isValidTriangle+0x38>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118f <isValidTriangle+0x8f>
movss  -0x8(%rbp),%xmm1
addss  -0x10(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    115d <isValidTriangle+0x5d>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118f <isValidTriangle+0x8f>
movss  -0xc(%rbp),%xmm1
addss  -0x10(%rbp),%xmm1
movss  -0x8(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1182 <isValidTriangle+0x82>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    118f <isValidTriangle+0x8f>
movss  0xe76(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<isValidTriangle>:
movaps %xmm0,%xmm3
addss  %xmm1,%xmm3
movaps %xmm0,%xmm4
addss  %xmm2,%xmm4
cmpltss %xmm1,%xmm4
addss  %xmm2,%xmm1
cmpltss %xmm2,%xmm3
movss  0xedc(%rip),%xmm2
andnps %xmm2,%xmm4
andnps %xmm4,%xmm3
cmpltss %xmm0,%xmm1
andnps %xmm3,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @isValidTriangle(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
%8 = load float, float* %5
%9 = load float, float* %6
%10 = fadd float %8, %9
%11 = load float, float* %7
%12 = fcmp olt float %10, %11
br i1 %12, label %13, label %14
13: ; preds = %3
store float 0.000000e+00, float* %4
br label %29
14: ; preds = %3
%15 = load float, float* %5
%16 = load float, float* %7
%17 = fadd float %15, %16
%18 = load float, float* %6
%19 = fcmp olt float %17, %18
br i1 %19, label %20, label %21
20: ; preds = %14
store float 0.000000e+00, float* %4
br label %29
21: ; preds = %14
%22 = load float, float* %6
%23 = load float, float* %7
%24 = fadd float %22, %23
%25 = load float, float* %5
%26 = fcmp olt float %24, %25
br i1 %26, label %27, label %28
27: ; preds = %21
store float 0.000000e+00, float* %4
br label %29
28: ; preds = %21
store float 1.000000e+00, float* %4
br label %29
29: ; preds = %28, %27, %20, %13
%30 = load float, float* %4
ret float %30
}

LLVM IR (-O2):
define float @isValidTriangle(float %0, float %1, float %2) {
%4 = fadd float %0, %1
%5 = fcmp olt float %4, %2
%6 = fadd float %0, %2
%7 = fcmp olt float %6, %1
%8 = or i1 %5, %7
%9 = fadd float %1, %2
%10 = fcmp olt float %9, %0
%11 = or i1 %10, %8
%12 = select i1 %11, float 0.000000e+00, float 1.000000e+00
ret float %12
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ wiznetRegReadWord(int /*<<< orphan*/, int);
uint16_t wiznetGetSocketTXFreeSize(uint8_t socket) {
  return wiznetRegReadWord(socket, (0x0000 + 0x0020));
}


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

x86 assembly (clang, -O2):
<wiznetGetSocketTXFreeSize>:
mov    $0x20,%esi
jmp    1030 <wiznetRegReadWord@plt>

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

LLVM IR (-O2):
define i32 @wiznetGetSocketTXFreeSize(i32 %0) {
%2 = tail call i32 @wiznetRegReadWord(i32 %0, i32 32)
ret i32 %2
}
unsigned short zigzagdec16(unsigned short x) { return x >> 1 ^ -(x & 1); }


x86 assembly (clang, -O0):
<zigzagdec16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
sar    $0x1,%eax
movzwl -0x2(%rbp),%edx
and    $0x1,%edx
xor    %ecx,%ecx
sub    %edx,%ecx
xor    %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zigzagdec16>:
mov    %edi,%eax
shr    %eax
and    $0x1,%edi
neg    %edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @zigzagdec16(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = ashr i32 %4, 1
%6 = load i16, i16* %2
%7 = zext i16 %6 to i32
%8 = and i32 %7, 1
%9 = sub nsw i32 0, %8
%10 = xor i32 %5, %9
%11 = trunc i32 %10 to i16
ret i16 %11
}

LLVM IR (-O2):
define zeroext i16 @zigzagdec16(i16 zeroext %0) {
%2 = lshr i16 %0, 1
%3 = and i16 %0, 1
%4 = sub nsw i16 0, %3
%5 = xor i16 %2, %4
ret i16 %5
}
unsigned long XWhitePixel() {}


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

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

LLVM IR (-O0):
define i64 @XWhitePixel() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @XWhitePixel() {
ret i64 undef
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(char *, char const *, int);
int strlen(char const *);
scalar_t__ xmalloc(int);
char *strdup(const char *str) {
  int length = strlen(str) + 1;
  char *newstr = (char *)xmalloc(length);
  memcpy(newstr, str, length);
  return (newstr);
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
lea    0x1(%rax),%ebp
mov    %ebp,%edi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebp,%edx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = call i64 @xmalloc(i32 %8)
%10 = inttoptr i64 %9 to i8*
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i32, i32* %3
%14 = call i32 @memcpy(i8* %11, i8* %12, i32 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = tail call i64 @xmalloc(i32 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i32 %3)
ret i8* %5
}