xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World");
  return (0);
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ subwindow;
};
typedef TYPE_1__ XKeyReleasedEvent;

/* Variables and functions */
unsigned long get_XKeyReleasedEvent_subwindow(void *_p) {
  return (unsigned long)((XKeyReleasedEvent *)_p)->subwindow;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XKeyReleasedEvent_subwindow(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XKeyReleasedEvent_subwindow(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void stbiw__write_run_data(FILE *f, int length, unsigned char databyte) {
  unsigned char lengthbyte = (unsigned char)(length + 128);
  assert(length + 128 <= 255);
  fwrite(&lengthbyte, 1, 1, f);
  fwrite(&databyte, 1, 1, f);
}


x86 assembly (clang, -O0):
<stbiw__write_run_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%eax
add    $0x80,%eax
mov    %al,-0xe(%rbp)
mov    -0xc(%rbp),%eax
add    $0x80,%eax
cmp    $0xff,%eax
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rcx
lea    -0xe(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <fwrite@plt>
mov    -0x8(%rbp),%rcx
lea    -0xd(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1040 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stbiw__write_run_data>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x80,%esi
setl   %dil
call   1040 <assert@plt>
movsbl %bpl,%edi
xor    $0xffffff80,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
movsbl %r14b,%edi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @stbiw__write_run_data(i32* %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8
%7 = alloca i8
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 128
%10 = trunc i32 %9 to i8
store i8 %10, i8* %7
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 128
%13 = icmp sle i32 %12, 255
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32*, i32** %4
%17 = call i32 @fwrite(i8* %7, i32 1, i32 1, i32* %16)
%18 = load i32*, i32** %4
%19 = call i32 @fwrite(i8* %6, i32 1, i32 1, i32* %18)
ret void
}

LLVM IR (-O2):
define void @stbiw__write_run_data(i32* nocapture %0, i32 %1, i8 zeroext %2) {
%4 = icmp slt i32 %1, 128
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = shl i32 %1, 24
%8 = ashr exact i32 %7, 24
%9 = xor i32 %8, -128
%10 = tail call i32 @fputc(i32 %9, i32* %0)
%11 = sext i8 %2 to i32
%12 = tail call i32 @fputc(i32 %11, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ StabilizationDesiredHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void StabilizationDesiredRequestUpdate() {
  UAVObjRequestUpdate(StabilizationDesiredHandle());
}


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

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

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

LLVM IR (-O2):
define void @StabilizationDesiredRequestUpdate() {
%1 = tail call i32 (...) @StabilizationDesiredHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
/* Variables and functions */
char *badd(char *, char *);
int /*<<< orphan*/ printf(char *, char *, ...);
int main(void) {
  char *a = "9726", *b = "45", *c = badd(a, b);
  printf("%s+%s=", a, b);
  printf("%s\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xec4(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <badd@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xed4(%rip),%r15
lea    0xed2(%rip),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <badd@plt>
mov    %rax,%rbx
lea    0xec0(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"9726\00"
@.str.1 = [3 x i8] c"45\00"
@.str.2 = [7 x i8] c"%s+%s=\00"
@.str.3 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8** %3
%5 = load i8*, i8** %2
%6 = load i8*, i8** %3
%7 = call i8* @badd(i8* %5, i8* %6)
store i8* %7, i8** %4
%8 = load i8*, i8** %2
%9 = load i8*, i8** %3
%10 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %8, i8* %9)
%11 = load i8*, i8** %4
%12 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"9726\00"
@.str.1 = [3 x i8] c"45\00"
@.str.2 = [7 x i8] c"%s+%s=\00"
@.str.3 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = tail call i8* @badd(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  int x;
  printf("Declare x first\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Declare x first\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ limpa_tela();
int /*<<< orphan*/ pausa();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ temporizador(double);
void hello() {
  limpa_tela();
  printf("Hello World!\n");
  temporizador(1.5);
  printf("Bem-vindo!\n");
  pausa();
}


x86 assembly (clang, -O0):
<hello>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <limpa_tela@plt>
lea    0xeb6(%rip),%rdi
call   1040 <printf@plt>
movsd  0xea1(%rip),%xmm0
call   1030 <temporizador@plt>
lea    0xeab(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <pausa@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hello>:
push   %rax
xor    %eax,%eax
call   1050 <limpa_tela@plt>
lea    0xeb9(%rip),%rdi
call   1030 <puts@plt>
movsd  0xea4(%rip),%xmm0
call   1040 <temporizador@plt>
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <pausa@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [12 x i8] c"Bem-vindo!\0A\00"
define void @hello() {
%1 = call i32 (...) @limpa_tela()
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @temporizador(double 1.500000e+00)
%4 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 (...) @pausa()
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
@str.2 = [11 x i8] c"Bem-vindo!\00"
define void @hello() {
%1 = tail call i32 (...) @limpa_tela()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @temporizador(double 1.500000e+00)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 (...) @pausa()
ret void
}
int ft_isdigit(int c) { return (c >= '0' && c <= '9'); }


x86 assembly (clang, -O0):
<ft_isdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x30,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_isdigit+0x20>
cmpl   $0x39,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_isdigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 48
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 57
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
int letter(c)
register char c;
{ return (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c == '_'); }


x86 assembly (clang, -O0):
<letter>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <letter+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <letter+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x41,%eax
jl     1148 <letter+0x48>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x5a,%ecx
mov    %al,-0x2(%rbp)
jle    1155 <letter+0x55>
movsbl -0x1(%rbp),%eax
cmp    $0x5f,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<letter>:
shl    $0x18,%edi
mov    %edi,%eax
and    $0xdf000000,%eax
add    $0xbfffffff,%eax
cmp    $0x1affffff,%eax
setb   %al
cmp    $0x5f000000,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @letter(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %23, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br i1 %18, label %23, label %19
19: ; preds = %15, %11
%20 = load i8, i8* %2
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 95
br label %23
23: ; preds = %19, %15, %7
%24 = phi i1 [ true, %15 ], [ true, %7 ], [ %22, %19 ]
%25 = zext i1 %24 to i32
ret i32 %25
}

LLVM IR (-O2):
define i32 @letter(i32 %0) {
%2 = shl i32 %0, 24
%3 = and i32 %2, -553648128
%4 = add i32 %3, -1073741825
%5 = icmp ult i32 %4, 452984831
%6 = icmp eq i32 %2, 1593835520
%7 = or i1 %6, %5
%8 = zext i1 %7 to i32
ret i32 %8
}
__attribute__((noipa)) int f1(int x) { return x % 16 == 13; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0xd,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
lea    0xf(%rdi),%eax
test   %edi,%edi
cmovns %edi,%eax
and    $0xfffffff0,%eax
sub    %eax,%edi
xor    %eax,%eax
cmp    $0xd,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @f1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 16
%5 = icmp eq i32 %4, 13
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = srem i32 %0, 16
%3 = icmp eq i32 %2, 13
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
struct fb_fix_screeninfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FBIOGET_FSCREENINFO;
scalar_t__ ioctl(int, int /*<<< orphan*/, struct fb_fix_screeninfo *);
int /*<<< orphan*/ perror(char *);
int fb_fscrn_get(int fbfp, struct fb_fix_screeninfo *scinfo) {
  if (ioctl(fbfp, FBIOGET_FSCREENINFO, scinfo)) {
    perror("ioctl FBIOGET_FSCREENINFO error\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fb_fscrn_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
je     1166 <fb_fscrn_get+0x46>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <fb_fscrn_get+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_fscrn_get>:
push   %rax
mov    %rsi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    113e <fb_fscrn_get+0x1e>
pop    %rcx
ret
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.fb_fix_screeninfo = type { i32 }
@FBIOGET_FSCREENINFO = global i32 0
@.str = [33 x i8] c"ioctl FBIOGET_FSCREENINFO error\0A\00"
define i32 @fb_fscrn_get(i32 %0, %struct.fb_fix_screeninfo* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct.fb_fix_screeninfo*
store i32 %0, i32* %4
store %struct.fb_fix_screeninfo* %1, %struct.fb_fix_screeninfo** %5
%6 = load i32, i32* %4
%7 = load i32, i32* @FBIOGET_FSCREENINFO
%8 = load %struct.fb_fix_screeninfo*, %struct.fb_fix_screeninfo** %5
%9 = call i64 @ioctl(i32 %6, i32 %7, %struct.fb_fix_screeninfo* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %11
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
%struct.fb_fix_screeninfo = type { i32 }
@FBIOGET_FSCREENINFO = global i32 0
@.str = [33 x i8] c"ioctl FBIOGET_FSCREENINFO error\0A\00"
define i32 @fb_fscrn_get(i32 %0, %struct.fb_fix_screeninfo* %1) {
%3 = load i32, i32* @FBIOGET_FSCREENINFO
%4 = tail call i64 @ioctl(i32 %0, i32 %3, %struct.fb_fix_screeninfo* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
void *f1(void *p) { pthread_exit(NULL); }


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

x86 assembly (clang, -O2):
<f1>:
xor    %edi,%edi
jmp    1030 <pthread_exit@plt>

LLVM IR (-O0):
define i8* @f1(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @pthread_exit(i32* null)
%5 = load i8*, i8** %2
ret i8* %5
}

LLVM IR (-O2):
define noalias i8* @f1(i8* nocapture readnone %0) {
%2 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ expand(char *, int);
int /*<<< orphan*/ parseAndExecute(int /*<<< orphan*/);
int turn(int /*<<< orphan*/);
bool processInput(char *ptr, int size) {
  return turn(parseAndExecute(expand(ptr, size)));
}


x86 assembly (clang, -O0):
<processInput>:
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   1050 <expand@plt>
mov    %eax,%edi
call   1040 <parseAndExecute@plt>
mov    %eax,%edi
call   1030 <turn@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processInput>:
push   %rax
call   1050 <expand@plt>
mov    %eax,%edi
call   1040 <parseAndExecute@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <turn@plt>

LLVM IR (-O0):
define i32 @processInput(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 @expand(i8* %5, i32 %6)
%8 = call i32 @parseAndExecute(i32 %7)
%9 = call i32 @turn(i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @processInput(i8* %0, i32 %1) {
%3 = tail call i32 @expand(i8* %0, i32 %1)
%4 = tail call i32 @parseAndExecute(i32 %3)
%5 = tail call i32 @turn(i32 %4)
ret i32 %5
}
/* Variables and functions */
void *memchr(const void *ptr, int value, size_t num) { return 0; }


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

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

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

LLVM IR (-O2):
define noalias i8* @memchr(i8* nocapture readnone %0, i32 %1, i64 %2) {
ret i8* null
}
/* Variables and functions */
int syscall1(int);
int getpid() { return syscall1(20); }


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

x86 assembly (clang, -O2):
<getpid>:
mov    $0x14,%edi
jmp    1030 <syscall1@plt>

LLVM IR (-O0):
define i32 @getpid() {
%1 = call i32 @syscall1(i32 20)
ret i32 %1
}

LLVM IR (-O2):
define i32 @getpid() {
%1 = tail call i32 @syscall1(i32 20)
ret i32 %1
}
/* Variables and functions */
long RAND_MAX;
long rand();
long get_rand() { return (long)rand() * RAND_MAX + rand(); }


x86 assembly (clang, -O0):
<get_rand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    0x2ec2(%rip),%rcx
imul   (%rcx),%rax
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_rand>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rbx
mov    0x2ec6(%rip),%rax
imul   (%rax),%rbx
xor    %eax,%eax
call   1030 <rand@plt>
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define i64 @get_rand() {
%1 = call i64 (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = mul nsw i64 %1, %2
%4 = call i64 (...) @rand()
%5 = add nsw i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define i64 @get_rand() {
%1 = tail call i64 (...) @rand()
%2 = load i64, i64* @RAND_MAX
%3 = mul nsw i64 %2, %1
%4 = tail call i64 (...) @rand()
%5 = add nsw i64 %3, %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
void test10_head() {
  do {
    printf("test10");
    puts("");
  } while (0);
}


x86 assembly (clang, -O0):
<test10_head>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <test10_head+0x9>
lea    0xed0(%rip),%rdi
call   1040 <printf@plt>
lea    0xeca(%rip),%rdi
call   1030 <puts@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test10_head>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"test10\00"
@.str.1 = [1 x i8] zeroinitializer
define void @test10_head() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"test10\00"
define void @test10_head() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ freopen(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
void init() {
  freopen("teacher.in", "r", stdin);
  freopen("teacher.out", "w", stdout);
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
lea    0xedc(%rip),%rdi
lea    0xee0(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
lea    0xecd(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <freopen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edx
lea    0xedf(%rip),%rdi
lea    0xee3(%rip),%rsi
call   1030 <freopen@plt>
mov    0x2ea4(%rip),%rax
mov    (%rax),%edx
lea    0xed0(%rip),%rdi
lea    0xed5(%rip),%rsi
pop    %rax
jmp    1030 <freopen@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"teacher.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [12 x i8] c"teacher.out\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = call i32 @freopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = call i32 @freopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"teacher.in\00"
@.str.1 = [2 x i8] c"r\00"
@stdin = global i32 0
@.str.2 = [12 x i8] c"teacher.out\00"
@.str.3 = [2 x i8] c"w\00"
@stdout = global i32 0
define void @init() {
%1 = load i32, i32* @stdin
%2 = tail call i32 @freopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @stdout
%4 = tail call i32 @freopen(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ parson_malloc(size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
char *parson_strndup(const char *string, size_t n) {
  char *output_string = (char *)parson_malloc(n + 1);
  if (!output_string)
    return NULL;
  output_string[n] = '\0';
  strncpy(output_string, string, n);
  return output_string;
}


x86 assembly (clang, -O0):
<parson_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <parson_malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1159 <parson_strndup+0x39>
movq   $0x0,-0x8(%rbp)
jmp    117e <parson_strndup+0x5e>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parson_strndup>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x1(%rsi),%rdi
call   1040 <parson_malloc@plt>
test   %rax,%rax
je     1151 <parson_strndup+0x31>
mov    %rax,%rbx
movb   $0x0,(%rax,%r14,1)
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <strncpy@plt>
jmp    1153 <parson_strndup+0x33>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i8* @parson_strndup(i8* %0, i64 %1) {
%3 = add i64 %1, 1
%4 = tail call i64 @parson_malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = icmp eq i64 %4, 0
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = getelementptr inbounds i8, i8* %5, i64 %1
store i8 0, i8* %8
%9 = tail call i32 @strncpy(i8* %5, i8* %0, i64 %1)
br label %10
10: ; preds = %2, %7
%11 = phi i8* [ %5, %7 ], [ null, %2 ]
ret i8* %11
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void delay(volatile uint32_t count) {
  for (; count > 0; count--) {
  }
}


x86 assembly (clang, -O0):
<delay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmp    $0x0,%rax
jle    112c <delay+0x2c>
jmp    111b <delay+0x1b>
mov    -0x8(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <delay+0x8>
pop    %rbp
ret

x86 assembly (clang, -O2):
<delay>:
mov    %rdi,-0x8(%rsp)
cmpq   $0x0,-0x8(%rsp)
jle    111e <delay+0x1e>
nopl   (%rax)
addq   $0xffffffffffffffff,-0x8(%rsp)
cmpq   $0x0,-0x8(%rsp)
jg     1110 <delay+0x10>
ret

LLVM IR (-O0):
define void @delay(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
br label %3
3: ; preds = %7, %1
%4 = load volatile i64, i64* %2
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
br label %7
7: ; preds = %6
%8 = load volatile i64, i64* %2
%9 = add nsw i64 %8, -1
store volatile i64 %9, i64* %2
br label %3
10: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @delay(i64 %0) {
%2 = alloca i64
store volatile i64 %0, i64* %2
%3 = load volatile i64, i64* %2
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1, %5
%6 = load volatile i64, i64* %2
%7 = add nsw i64 %6, -1
store volatile i64 %7, i64* %2
%8 = load volatile i64, i64* %2
%9 = icmp sgt i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Delay(int /*<<< orphan*/);
int /*<<< orphan*/ Port_Init();
int /*<<< orphan*/ pila_debug_init();
void sys_init() {
  (*(volatile unsigned *)0x1e00008) = 0x0;
  (*(volatile unsigned *)0x1e00000) = 0x1;
  (*(volatile unsigned *)0x1e00024) = 0xffffffff;
  (*(volatile unsigned *)0x1d20054) = 0xf;
  Port_Init();
  Delay(0);
  pila_debug_init();
  (*(volatile unsigned *)0x1e0000c) = ~(0x1 << 26);
}


x86 assembly (clang, -O0):
<sys_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1e00008,%eax
movl   $0x0,(%rax)
mov    $0x1e00000,%eax
movl   $0x1,(%rax)
mov    $0x1e00024,%eax
movl   $0xffffffff,(%rax)
mov    $0x1d20054,%eax
movl   $0xf,(%rax)
mov    $0x0,%al
call   1040 <Port_Init@plt>
xor    %edi,%edi
call   1030 <Delay@plt>
mov    $0x0,%al
call   1050 <pila_debug_init@plt>
mov    $0x1e0000c,%eax
movl   $0xfbffffff,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_init>:
push   %rax
movl   $0x0,0x1e00008
movl   $0x1,0x1e00000
movl   $0xffffffff,0x1e00024
ff ff ff ff
movl   $0xf,0x1d20054
xor    %eax,%eax
call   1040 <Port_Init@plt>
xor    %edi,%edi
call   1030 <Delay@plt>
xor    %eax,%eax
call   1050 <pila_debug_init@plt>
movl   $0xfbffffff,0x1e0000c
ff ff ff fb
pop    %rax
ret

LLVM IR (-O0):
define void @sys_init() {
store volatile i32 0, i32* inttoptr (i64 31457288 to i32*)
store volatile i32 1, i32* inttoptr (i64 31457280 to i32*)
store volatile i32 -1, i32* inttoptr (i64 31457316 to i32*)
store volatile i32 15, i32* inttoptr (i64 30539860 to i32*)
%1 = call i32 (...) @Port_Init()
%2 = call i32 @Delay(i32 0)
%3 = call i32 (...) @pila_debug_init()
store volatile i32 -67108865, i32* inttoptr (i64 31457292 to i32*)
ret void
}

LLVM IR (-O2):
define void @sys_init() {
store volatile i32 0, i32* inttoptr (i64 31457288 to i32*)
store volatile i32 1, i32* inttoptr (i64 31457280 to i32*)
store volatile i32 -1, i32* inttoptr (i64 31457316 to i32*)
store volatile i32 15, i32* inttoptr (i64 30539860 to i32*)
%1 = tail call i32 (...) @Port_Init()
%2 = tail call i32 @Delay(i32 0)
%3 = tail call i32 (...) @pila_debug_init()
store volatile i32 -67108865, i32* inttoptr (i64 31457292 to i32*)
ret void
}
unsigned long largest_pow_2(unsigned long n) {
  unsigned long v = 1;
  if (!n)
    return 0;
  for (n >>= 1; n; n >>= 1)
    v = (v << 1);
  return v;
}


x86 assembly (clang, -O0):
<largest_pow_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movq   $0x1,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1128 <largest_pow_2+0x28>
movq   $0x0,-0x8(%rbp)
jmp    1164 <largest_pow_2+0x64>
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115c <largest_pow_2+0x5c>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <largest_pow_2+0x34>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<largest_pow_2>:
test   %rdi,%rdi
je     1130 <largest_pow_2+0x30>
mov    $0x1,%eax
cmp    $0x1,%rdi
je     112f <largest_pow_2+0x2f>
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
shr    %rcx
add    %rax,%rax
cmp    $0x4,%rdi
mov    %rcx,%rdi
jae    1120 <largest_pow_2+0x20>
ret
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i64 @largest_pow_2(i64 %0) {
switch i64 %0, label %2 [
i64 0, label %9
i64 1, label %8
]
2: ; preds = %1, %2
%3 = phi i64 [ %6, %2 ], [ 1, %1 ]
%4 = phi i64 [ %5, %2 ], [ %0, %1 ]
%5 = lshr i64 %4, 1
%6 = shl i64 %3, 1
%7 = icmp ult i64 %4, 4
br i1 %7, label %9, label %2
8: ; preds = %1
br label %9
9: ; preds = %2, %1, %8
%10 = phi i64 [ %0, %1 ], [ 1, %8 ], [ %6, %2 ]
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ Display;
typedef int /*<<< orphan*/ *Cursor;

/* Variables and functions */
int /*<<< orphan*/ RootWindow(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ XC_left_ptr;
int /*<<< orphan*/ *XCreateFontCursor(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ XDefineCursor(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
void arrow(Display *display, int screen_num) {
  Cursor cursor;
  cursor = XCreateFontCursor(display, XC_left_ptr);
  if (cursor == NULL)
    exit(1);
  XDefineCursor(display, RootWindow(display, screen_num), cursor);
}


x86 assembly (clang, -O0):
<arrow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e86(%rip),%rax
mov    (%rax),%esi
call   1030 <XCreateFontCursor@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117a <arrow+0x3a>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <RootWindow@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x18(%rbp),%rdx
call   1050 <XDefineCursor@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arrow>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    0x2e8f(%rip),%rax
mov    (%rax),%esi
call   1030 <XCreateFontCursor@plt>
test   %rax,%rax
je     117c <arrow+0x3c>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1040 <RootWindow@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %rbp,%rdx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <XDefineCursor@plt>
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@XC_left_ptr = global i32 0
define void @arrow(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* @XC_left_ptr
%8 = call i32* @XCreateFontCursor(i32* %6, i32 %7)
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @exit(i32 1)
unreachable
13: ; preds = %2
%14 = load i32*, i32** %3
%15 = load i32*, i32** %3
%16 = load i32, i32* %4
%17 = call i32 @RootWindow(i32* %15, i32 %16)
%18 = load i32*, i32** %5
%19 = call i32 @XDefineCursor(i32* %14, i32 %17, i32* %18)
ret void
}

LLVM IR (-O2):
@XC_left_ptr = global i32 0
define void @arrow(i32* %0, i32 %1) {
%3 = load i32, i32* @XC_left_ptr
%4 = tail call i32* @XCreateFontCursor(i32* %0, i32 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = tail call i32 @RootWindow(i32* %0, i32 %1)
%10 = tail call i32 @XDefineCursor(i32* %0, i32 %9, i32* %4)
ret void
}
int *test_func_05(int *p, int *x) {
  int r = 0;
  r += *p++;
  r += *p++;
  r += *p++;
  *x = r;
  return p;
}


x86 assembly (clang, -O0):
<test_func_05>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_func_05>:
mov    0x4(%rdi),%ecx
add    (%rdi),%ecx
add    0x8(%rdi),%ecx
lea    0xc(%rdi),%rax
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define i32* @test_func_05(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
store i32 0, i32* %5
%6 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i32 1
store i32* %7, i32** %3
%8 = load i32, i32* %6
%9 = load i32, i32* %5
%10 = add nsw i32 %9, %8
store i32 %10, i32* %5
%11 = load i32*, i32** %3
%12 = getelementptr inbounds i32, i32* %11, i32 1
store i32* %12, i32** %3
%13 = load i32, i32* %11
%14 = load i32, i32* %5
%15 = add nsw i32 %14, %13
store i32 %15, i32* %5
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i32 1
store i32* %17, i32** %3
%18 = load i32, i32* %16
%19 = load i32, i32* %5
%20 = add nsw i32 %19, %18
store i32 %20, i32* %5
%21 = load i32, i32* %5
%22 = load i32*, i32** %4
store i32 %21, i32* %22
%23 = load i32*, i32** %3
ret i32* %23
}

LLVM IR (-O2):
define i32* @test_func_05(i32* %0, i32* nocapture writeonly %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, %4
%8 = getelementptr inbounds i32, i32* %0, i64 3
%9 = load i32, i32* %5
%10 = add nsw i32 %7, %9
store i32 %10, i32* %1
ret i32* %8
}
/* Variables and functions */
int /*<<< orphan*/ f4a(int);
void f4(int x) { f4a(x); }


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

x86 assembly (clang, -O2):
<f4>:
jmp    1030 <f4a@plt>

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

LLVM IR (-O2):
define void @f4(i32 %0) {
%2 = tail call i32 @f4a(i32 %0)
ret void
}
void clear_string(char string[10000]) {
  int i = 0;
  while (i < 10000) {
    string[i] = 0;
    i++;
  }
}


x86 assembly (clang, -O0):
<clear_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x2710,-0xc(%rbp)
jge    1136 <clear_string+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <clear_string+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_string>:
push   %rax
mov    $0x2710,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @clear_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %7, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 10000
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
store i8 0, i8* %11
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %4
14: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @clear_string(i8* nocapture writeonly %0) {
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
scalar_t__ isPrime(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  uint64_t base = 2;
  int pow;
  for (pow = 1; pow <= 32; pow++) {
    if (isPrime(base - 1)) {
      printf("2 ^ %d - 1\n", pow);
    }
    base *= 2;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jg     1182 <main+0x62>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <isPrime@plt>
cmp    $0x0,%rax
je     116b <main+0x4b>
mov    -0xc(%rbp),%esi
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x2,%r15d
mov    $0x1,%ebx
lea    0xec9(%rip),%r14
jmp    114b <main+0x2b>
nopl   0x0(%rax)
add    %r15d,%r15d
add    $0x1,%ebx
cmp    $0x21,%ebx
je     1165 <main+0x45>
lea    -0x1(%r15),%edi
call   1040 <isPrime@plt>
test   %rax,%rax
je     1140 <main+0x20>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
jmp    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [12 x i8] c"2 ^ %d - 1\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %9
%2 = phi i32 [ 1, %0 ], [ %11, %9 ]
%3 = phi i32 [ 2, %0 ], [ %10, %9 ]
%4 = add nsw i32 %3, -1
%5 = tail call i64 @isPrime(i32 %4)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %9
9: ; preds = %7, %1
%10 = shl nsw i32 %3, 1
%11 = add nuw nsw i32 %2, 1
%12 = icmp eq i32 %11, 33
br i1 %12, label %13, label %1
13: ; preds = %9
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void addHorzLine(FILE *fo, int tickness) {
  fprintf(fo, "<hr style=\"border-width:%dpx;\">", tickness);
}


x86 assembly (clang, -O0):
<addHorzLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<addHorzLine>:
mov    %esi,%edx
lea    0xee7(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"<hr style=\22border-width:%dpx;\22>\00"
define void @addHorzLine(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 = call i32 @fprintf(i32* %5, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [32 x i8] c"<hr style=\22border-width:%dpx;\22>\00"
define void @addHorzLine(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int continuar(int *n) {
  if (*n == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<continuar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jne    1121 <continuar+0x21>
movl   $0x0,-0x4(%rbp)
jmp    1128 <continuar+0x28>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<continuar>:
xor    %eax,%eax
cmpl   $0x0,(%rdi)
setne  %al
ret

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

LLVM IR (-O2):
define i32 @continuar(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int prc_a3(int a) {
  a = a + 30;
  printf("a+30 [%d]\n", a);
  return a;
}


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

x86 assembly (clang, -O2):
<prc_a3>:
push   %rbx
lea    0x1e(%rdi),%ebx
lea    0xee5(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"a+30 [%d]\0A\00"
define i32 @prc_a3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 30
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %2
ret i32 %7
}

LLVM IR (-O2):
@.str = [11 x i8] c"a+30 [%d]\0A\00"
define i32 @prc_a3(i32 %0) {
%2 = add nsw i32 %0, 30
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 %2
}
void ns_put16(unsigned s, unsigned char *cp) {
  *cp++ = s >> 8;
  *cp++ = s;
}


x86 assembly (clang, -O0):
<ns_put16>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_put16>:
rol    $0x8,%di
mov    %di,(%rsi)
ret

LLVM IR (-O0):
define void @ns_put16(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = lshr i32 %5, 8
%7 = trunc i32 %6 to i8
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
store i8 %7, i8* %8
%10 = load i32, i32* %3
%11 = trunc i32 %10 to i8
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i32 1
store i8* %13, i8** %4
store i8 %11, i8* %12
ret void
}

LLVM IR (-O2):
define void @ns_put16(i32 %0, i8* nocapture writeonly %1) {
%3 = lshr i32 %0, 8
%4 = trunc i32 %3 to i8
%5 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %4, i8* %1
%6 = trunc i32 %0 to i8
store i8 %6, i8* %5
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int const uint16_t;

/* Variables and functions */
uint16_t rfc4175_get_line_length(const uint8_t *buf) {
  return (buf[0] << 8) | buf[1];
}


x86 assembly (clang, -O0):
<rfc4175_get_line_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
shl    $0x8,%eax
mov    -0x8(%rbp),%rcx
or     0x4(%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rfc4175_get_line_length>:
mov    (%rdi),%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @rfc4175_get_line_length(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = load i32, i32* %4
%6 = or i32 %3, %5
ret i32 %6
}