xunge/DecIR huggingface dataset:
/* Variables and functions */
int smbw_fchdir(int);
int fchdir(int fd) { return smbw_fchdir(fd); }


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

x86 assembly (clang, -O2):
<fchdir>:
jmp    1030 <smbw_fchdir@plt>

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

LLVM IR (-O2):
define i32 @fchdir(i32 %0) {
%2 = tail call i32 @smbw_fchdir(i32 %0)
ret i32 %2
}
/* Variables and functions */
int RAND_MAX;
int rand();
int rand_lim2(int limit) {
  int divisor = RAND_MAX / (limit + 1);
  int retval;
  do {
    retval = rand() / divisor;
  } while (retval > limit);
  return retval;
}


x86 assembly (clang, -O0):
<rand_lim2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2ec6(%rip),%rax
mov    (%rax),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jg     1130 <rand_lim2+0x20>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_lim2>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2ecc(%rip),%rax
mov    (%rax),%eax
lea    0x1(%rbx),%ecx
cltd
idiv   %ecx
mov    %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebp
cmp    %ebx,%eax
jg     1130 <rand_lim2+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@RAND_MAX = global i32 0
define i32 @rand_lim2(i32 %0) {
%2 = load i32, i32* @RAND_MAX
%3 = add nsw i32 %0, 1
%4 = sdiv i32 %2, %3
br label %5
5: ; preds = %5, %1
%6 = tail call i32 (...) @rand()
%7 = sdiv i32 %6, %4
%8 = icmp sgt i32 %7, %0
br i1 %8, label %5, label %9
9: ; preds = %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World!\n");
  printf("I turned 100 today!\n");
  printf("But I am Old\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xede(%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>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World!\0A\00"
@.str.1 = [21 x i8] c"I turned 100 today!\0A\00"
@.str.2 = [14 x i8] c"But I am Old\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World!\00"
@str.3 = [20 x i8] c"I turned 100 today!\00"
@str.4 = [13 x i8] c"But I am Old\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.3, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.4, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float f = (float)1 / (float)10;
  printf("%.1f\n", f);
}


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

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%.1f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 0x3FB99999A0000000)
ret i32 0
}
/* Variables and functions */
int do_smbus_recv_byte(int, unsigned int);
int smbus_recv_byte(unsigned device) {
  return do_smbus_recv_byte(0x1000, device);
}


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

x86 assembly (clang, -O2):
<smbus_recv_byte>:
mov    %edi,%esi
mov    $0x1000,%edi
jmp    1030 <do_smbus_recv_byte@plt>

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

LLVM IR (-O2):
define i32 @smbus_recv_byte(i32 %0) {
%2 = tail call i32 @do_smbus_recv_byte(i32 4096, i32 %0)
ret i32 %2
}
void OTAwifi() {}


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

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

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

LLVM IR (-O2):
define void @OTAwifi() {
ret void
}
int preferIPv6Addresses() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @preferIPv6Addresses() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ pthread_setschedprio;
int main(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
  (void)pthread_setschedprio;
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@pthread_setschedprio = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = load i32, i32* @pthread_setschedprio
%9 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@pthread_setschedprio = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ unix_error(char *);
void Bind(int sockfd, struct sockaddr *my_addr, int addrlen) {
  int n;
  if ((n = bind(sockfd, my_addr, addrlen)) < 0)
    unix_error("bind error");
}


x86 assembly (clang, -O0):
<Bind>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <bind@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jge    1159 <Bind+0x39>
lea    0xeac(%rip),%rdi
call   1030 <unix_error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Bind>:
push   %rax
call   1040 <bind@plt>
test   %eax,%eax
js     112c <Bind+0xc>
pop    %rax
ret
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <unix_error@plt>

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
@.str = [11 x i8] c"bind error\00"
define void @Bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load %struct.sockaddr*, %struct.sockaddr** %5
%10 = load i32, i32* %6
%11 = call i32 @bind(i32 %8, %struct.sockaddr* %9, i32 %10)
store i32 %11, i32* %7
%12 = icmp slt i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %3
%14 = call i32 @unix_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13, %3
ret void
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
@.str = [11 x i8] c"bind error\00"
define void @Bind(i32 %0, %struct.sockaddr* %1, i32 %2) {
%4 = tail call i32 @bind(i32 %0, %struct.sockaddr* %1, i32 %2)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @unix_error(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Variables and functions */
unsigned long ROTR(unsigned long, int);
unsigned long SHR(unsigned long, int);
unsigned long int S1(unsigned long int x) {
  return (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10));
}


x86 assembly (clang, -O0):
<S1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x11,%esi
call   1030 <ROTR@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x13,%esi
call   1030 <ROTR@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
xor    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1040 <SHR@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
xor    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<S1>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    $0x11,%esi
call   1030 <ROTR@plt>
mov    %rax,%r14
mov    %r15,%rdi
mov    $0x13,%esi
call   1030 <ROTR@plt>
mov    %rax,%rbx
xor    %r14,%rbx
mov    %r15,%rdi
mov    $0xa,%esi
call   1040 <SHR@plt>
xor    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i64 @S1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @ROTR(i64 %3, i32 17)
%5 = load i64, i64* %2
%6 = call i64 @ROTR(i64 %5, i32 19)
%7 = xor i64 %4, %6
%8 = load i64, i64* %2
%9 = call i64 @SHR(i64 %8, i32 10)
%10 = xor i64 %7, %9
ret i64 %10
}

LLVM IR (-O2):
define i64 @S1(i64 %0) {
%2 = tail call i64 @ROTR(i64 %0, i32 17)
%3 = tail call i64 @ROTR(i64 %0, i32 19)
%4 = xor i64 %3, %2
%5 = tail call i64 @SHR(i64 %0, i32 10)
%6 = xor i64 %4, %5
ret i64 %6
}
/* Type definitions */
struct io_file {
  int dummy;
};

/* Variables and functions */
int io_in(struct io_file *, int, unsigned char *, int);
int io_in_i2(struct io_file *f, int pos, short *i) {
  unsigned char x[2];
  const int r = io_in(f, pos, x, sizeof x);
  if (i)
    *i = (x[0] << 8) | x[1];
  return r;
}


x86 assembly (clang, -O0):
<io_in_i2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x1a(%rbp),%rdx
mov    $0x2,%ecx
call   1030 <io_in@plt>
mov    %eax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115d <io_in_i2+0x4d>
movzbl -0x1a(%rbp),%eax
shl    $0x8,%eax
movzbl -0x19(%rbp),%ecx
or     %ecx,%eax
mov    %ax,%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_in_i2>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
lea    0xe(%rsp),%rdx
mov    $0x2,%ecx
call   1030 <io_in@plt>
test   %rbx,%rbx
je     1138 <io_in_i2+0x28>
movzwl 0xe(%rsp),%ecx
rol    $0x8,%cx
mov    %cx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.io_file = type { i32 }
define i32 @io_in_i2(%struct.io_file* %0, i32 %1, i16* %2) {
%4 = alloca %struct.io_file*
%5 = alloca i32
%6 = alloca i16*
%7 = alloca [2 x i8]
%8 = alloca i32
store %struct.io_file* %0, %struct.io_file** %4
store i32 %1, i32* %5
store i16* %2, i16** %6
%9 = load %struct.io_file*, %struct.io_file** %4
%10 = load i32, i32* %5
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%12 = call i32 @io_in(%struct.io_file* %9, i32 %10, i8* %11, i32 2)
store i32 %12, i32* %8
%13 = load i16*, i16** %6
%14 = icmp ne i16* %13, null
br i1 %14, label %15, label %26
15: ; preds = %3
%16 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 0
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = getelementptr inbounds [2 x i8], [2 x i8]* %7, i64 0, i64 1
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = or i32 %19, %22
%24 = trunc i32 %23 to i16
%25 = load i16*, i16** %6
store i16 %24, i16* %25
br label %26
26: ; preds = %15, %3
%27 = load i32, i32* %8
ret i32 %27
}

LLVM IR (-O2):
%struct.io_file = type { i32 }
define i32 @io_in_i2(%struct.io_file* %0, i32 %1, i16* writeonly %2) {
%4 = alloca [2 x i8]
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 0
%6 = call i32 @io_in(%struct.io_file* %0, i32 %1, i8* %5, i32 2)
%7 = icmp eq i16* %2, null
br i1 %7, label %16, label %8
8: ; preds = %3
%9 = load i8, i8* %5
%10 = zext i8 %9 to i16
%11 = shl nuw i16 %10, 8
%12 = getelementptr inbounds [2 x i8], [2 x i8]* %4, i64 0, i64 1
%13 = load i8, i8* %12
%14 = zext i8 %13 to i16
%15 = or i16 %11, %14
store i16 %15, i16* %2
br label %16
16: ; preds = %8, %3
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int some_symbol();
int /*<<< orphan*/ stderr;
int main() {
  int ret = some_symbol();
  if (ret == 1)
    return 0;
  fprintf(stderr, "ret was %i instead of 1\n", ret);
  return -1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <some_symbol@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114f <main+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    116e <main+0x4e>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
lea    0xe9e(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <some_symbol@plt>
cmp    $0x1,%eax
je     114b <main+0x2b>
mov    0x2eaa(%rip),%rcx
mov    (%rcx),%edi
lea    0xec1(%rip),%rsi
mov    %eax,%edx
call   1040 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"ret was %i instead of 1\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @some_symbol()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 0, i32* %1
br label %11
7: ; preds = %0
%8 = load i32, i32* @stderr
%9 = load i32, i32* %2
%10 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %9)
store i32 -1, i32* %1
br label %11
11: ; preds = %7, %6
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"ret was %i instead of 1\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @some_symbol()
%2 = icmp eq i32 %1, 1
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %1)
br label %6
6: ; preds = %0, %3
%7 = phi i32 [ -1, %3 ], [ 0, %0 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ gfx_set_video_enable(int /*<<< orphan*/);
void cs5530_reset_video(void) { gfx_set_video_enable(0); }


x86 assembly (clang, -O0):
<cs5530_reset_video>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <gfx_set_video_enable@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cs5530_reset_video() {
%1 = call i32 @gfx_set_video_enable(i32 0)
ret void
}

LLVM IR (-O2):
define void @cs5530_reset_video() {
%1 = tail call i32 @gfx_set_video_enable(i32 0)
ret void
}
int isprime(unsigned int p) {
  unsigned int i;
  if ((p & 1) == 0)
    return 0;
  for (i = 3; i * i <= p; i += 2) {
    if (p % i == 0)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isprime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1122 <isprime+0x22>
movl   $0x0,-0x4(%rbp)
jmp    1170 <isprime+0x70>
movl   $0x3,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
ja     1169 <isprime+0x69>
mov    -0x8(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
cmp    $0x0,%edx
jne    1156 <isprime+0x56>
movl   $0x0,-0x4(%rbp)
jmp    1170 <isprime+0x70>
jmp    115b <isprime+0x5b>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <isprime+0x29>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprime>:
xor    %ecx,%ecx
test   $0x1,%dil
jne    110b <isprime+0xb>
mov    %ecx,%eax
ret
cmp    $0x9,%edi
jae    1116 <isprime+0x16>
mov    $0x1,%eax
ret
mov    $0x3,%esi
xor    %ecx,%ecx
nopl   (%rax)
mov    %edi,%eax
xor    %edx,%edx
div    %esi
test   %edx,%edx
je     1108 <isprime+0x8>
add    $0x2,%esi
mov    %esi,%eax
imul   %esi,%eax
cmp    %edi,%eax
jbe    1120 <isprime+0x20>
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isprime(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = and i32 %5, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %2
br label %27
9: ; preds = %1
store i32 3, i32* %4
br label %10
10: ; preds = %23, %9
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = mul i32 %11, %12
%14 = load i32, i32* %3
%15 = icmp ule i32 %13, %14
br i1 %15, label %16, label %26
16: ; preds = %10
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = urem i32 %17, %18
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %16
store i32 0, i32* %2
br label %27
22: ; preds = %16
br label %23
23: ; preds = %22
%24 = load i32, i32* %4
%25 = add i32 %24, 2
store i32 %25, i32* %4
br label %10
26: ; preds = %10
store i32 1, i32* %2
br label %27
27: ; preds = %26, %21, %8
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @isprime(i32 %0) {
%2 = and i32 %0, 1
%3 = icmp eq i32 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1
%5 = icmp ult i32 %0, 9
br i1 %5, label %14, label %9
6: ; preds = %9
%7 = mul i32 %13, %13
%8 = icmp ugt i32 %7, %0
br i1 %8, label %14, label %9
9: ; preds = %4, %6
%10 = phi i32 [ %13, %6 ], [ 3, %4 ]
%11 = urem i32 %0, %10
%12 = icmp eq i32 %11, 0
%13 = add i32 %10, 2
br i1 %12, label %14, label %6
14: ; preds = %9, %6, %4, %1
%15 = phi i32 [ 0, %1 ], [ 1, %4 ], [ 0, %9 ], [ 1, %6 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) { printf("usage: `ed2ksum [FILE] ...' or `-h'\n"); }


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

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

LLVM IR (-O0):
@.str = [37 x i8] c"usage: `ed2ksum [FILE] ...' or `-h'\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [36 x i8] c"usage: `ed2ksum [FILE] ...' or `-h'\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ RAND_MAX;
int rand();
char randomchar(void) {
  int rint = rand();
  double r = (double)rint;
  r /= (double)RAND_MAX + 1;
  r *= 10 + 26 + 26;
  return "0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"[(
      int)r];
}


x86 assembly (clang, -O0):
<randomchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    0x2eb5(%rip),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xec8(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xea6(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
movslq %eax,%rcx
lea    0xe9d(%rip),%rax
movsbl (%rax,%rcx,1),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randomchar>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %eax,%xmm0
mov    0x2ec5(%rip),%rax
cvtsi2sdq (%rax),%xmm1
addsd  0xed0(%rip),%xmm1
divsd  %xmm1,%xmm0
mulsd  0xecc(%rip),%xmm0
cvttsd2si %xmm0,%eax
cltq
lea    0xec7(%rip),%rcx
mov    (%rax,%rcx,1),%al
pop    %rcx
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
@.str = [63 x i8] c"0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM\00"
define signext i8 @randomchar() {
%1 = alloca i32
%2 = alloca double
%3 = call i32 (...) @rand()
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = sitofp i32 %4 to double
store double %5, double* %2
%6 = load i64, i64* @RAND_MAX
%7 = sitofp i64 %6 to double
%8 = fadd double %7, 1.000000e+00
%9 = load double, double* %2
%10 = fdiv double %9, %8
store double %10, double* %2
%11 = load double, double* %2
%12 = fmul double %11, 6.200000e+01
store double %12, double* %2
%13 = load double, double* %2
%14 = fptosi double %13 to i32
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [63 x i8], [63 x i8]* @.str, i64 0, i64 %15
%17 = load i8, i8* %16
ret i8 %17
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
@.str = [63 x i8] c"0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM\00"
define signext i8 @randomchar() {
%1 = tail call i32 (...) @rand()
%2 = sitofp i32 %1 to double
%3 = load i64, i64* @RAND_MAX
%4 = sitofp i64 %3 to double
%5 = fadd double %4, 1.000000e+00
%6 = fdiv double %2, %5
%7 = fmul double %6, 6.200000e+01
%8 = fptosi double %7 to i32
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [63 x i8], [63 x i8]* @.str, i64 0, i64 %9
%11 = load i8, i8* %10
ret i8 %11
}
/* Variables and functions */
scalar_t__ getlogin();
scalar_t__ getuid();
int /*<<< orphan*/ printf(char *, unsigned int);
unsigned int who_am_i() {
  printf("\n getlogin says I am %u\n", (unsigned int)getlogin());
  printf("\n getuid says I am %u\n", (unsigned int)getuid());
}


x86 assembly (clang, -O0):
<who_am_i>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <getlogin@plt>
mov    %eax,%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<who_am_i>:
push   %rax
xor    %eax,%eax
call   1050 <getlogin@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <getuid@plt>
lea    0xec5(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"\0A getlogin says I am %u\0A\00"
@.str.1 = [23 x i8] c"\0A getuid says I am %u\0A\00"
define i32 @who_am_i() {
%1 = alloca i32
%2 = call i64 (...) @getlogin()
%3 = trunc i64 %2 to i32
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i64 (...) @getuid()
%6 = trunc i64 %5 to i32
%7 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [25 x i8] c"\0A getlogin says I am %u\0A\00"
@.str.1 = [23 x i8] c"\0A getuid says I am %u\0A\00"
define i32 @who_am_i() {
%1 = tail call i64 (...) @getlogin()
%2 = trunc i64 %1 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i64 (...) @getuid()
%5 = trunc i64 %4 to i32
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 undef
}
int mdp4_lcdc_overlay_blt_offset(struct msm_fb_data_type *mfd,
                                 struct msmfb_overlay_blt *req) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.msm_fb_data_type = type opaque
%struct.msmfb_overlay_blt = type opaque
define i32 @mdp4_lcdc_overlay_blt_offset(%struct.msm_fb_data_type* nocapture readnone %0, %struct.msmfb_overlay_blt* nocapture readnone %1) {
ret i32 0
}
void fc235(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    goto a;
    0;
  };
a:;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc235(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = load i32, i32* %2
%8 = zext i32 %7 to i64
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
br label %19
19: ; preds = %1
%20 = load i32, i32* %2
%21 = zext i32 %20 to i64
ret void
}

LLVM IR (-O2):
define void @fc235(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int students;
  int *studentsp;
  students = 12;
  studentsp = &students;
  printf("students:  %d\n", students);
  printf("studentsp: %p\n", studentsp);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xc,0x4(%rsp)
lea    0xee0(%rip),%rdi
mov    $0xc,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"students: %d\0A\00"
@.str.1 = [15 x i8] c"studentsp: %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 12, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 12)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32* %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put32(unsigned int);
int /*<<< orphan*/ put8(int);
void sub_reg32_m32(int reg32, void *_m32) {
  unsigned long *m32 = (unsigned long *)_m32;
  put8(0x2B);
  put8((reg32 << 3) | 5);
  put32((unsigned int)(m32));
}


x86 assembly (clang, -O0):
<sub_reg32_m32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x2b,%edi
call   1030 <put8@plt>
mov    -0x4(%rbp),%edi
shl    $0x3,%edi
or     $0x5,%edi
call   1030 <put8@plt>
mov    -0x18(%rbp),%rax
mov    %eax,%edi
call   1040 <put32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_reg32_m32>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebx
mov    $0x2b,%edi
call   1030 <put8@plt>
lea    0x5(,%rbx,8),%edi
call   1030 <put8@plt>
mov    %r14d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <put32@plt>

LLVM IR (-O0):
define void @sub_reg32_m32(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = bitcast i8* %6 to i64*
store i64* %7, i64** %5
%8 = call i32 @put8(i32 43)
%9 = load i32, i32* %3
%10 = shl i32 %9, 3
%11 = or i32 %10, 5
%12 = call i32 @put8(i32 %11)
%13 = load i64*, i64** %5
%14 = ptrtoint i64* %13 to i32
%15 = call i32 @put32(i32 %14)
ret void
}

LLVM IR (-O2):
define void @sub_reg32_m32(i32 %0, i8* %1) {
%3 = tail call i32 @put8(i32 43)
%4 = shl i32 %0, 3
%5 = or i32 %4, 5
%6 = tail call i32 @put8(i32 %5)
%7 = ptrtoint i8* %1 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @put32(i32 %8)
ret void
}
/* Variables and functions */
scalar_t__ getenv(char *);
int default_block_size(void) { return getenv("POSIXLY_CORRECT") ? 512 : 1024; }


x86 assembly (clang, -O0):
<default_block_size>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,%rdx
mov    $0x400,%eax
mov    $0x200,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<default_block_size>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <getenv@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
shl    $0x9,%ecx
add    $0x200,%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"POSIXLY_CORRECT\00"
define i32 @default_block_size() {
%1 = call i64 @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = icmp ne i64 %1, 0
%3 = zext i1 %2 to i64
%4 = select i1 %2, i32 512, i32 1024
ret i32 %4
}

LLVM IR (-O2):
@.str = [16 x i8] c"POSIXLY_CORRECT\00"
define i32 @default_block_size() {
%1 = tail call i64 @getenv(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i64 %1, 0
%3 = select i1 %2, i32 1024, i32 512
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_entity(int /*<<< orphan*/, char *,
                                             char *);
void test_tcl_comment_entities() {
  test_parser_verify_entity(test_parser_sourcefile("tcl", " #comment"),
                            "comment", "#comment");
}


x86 assembly (clang, -O0):
<test_tcl_comment_entities>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec6(%rip),%rsi
lea    0xebe(%rip),%rdx
call   1040 <test_parser_verify_entity@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_tcl_comment_entities>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed5(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
lea    0xecb(%rip),%rsi
lea    0xec3(%rip),%rdx
mov    %eax,%edi
pop    %rax
jmp    1040 <test_parser_verify_entity@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"tcl\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"#comment\00"
define void @test_tcl_comment_entities() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"tcl\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [8 x i8] c"comment\00"
@.str.3 = [9 x i8] c"#comment\00"
define void @test_tcl_comment_entities() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_entity(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ f0(int /*<<< orphan*/ *);
void f2(long unsigned int a) {
  if (a <= 11) {
    uint32_t x[a];
    f0(x);
  }
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0xb,-0x8(%rbp)
ja     1157 <f2+0x47>
mov    -0x8(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,%rsp
mov    %rax,-0x18(%rbp)
call   1030 <f0@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
cmp    $0xb,%rdi
ja     1145 <f2+0x35>
push   %rbp
mov    %rsp,%rbp
push   %rbx
push   %rax
mov    %rsp,%rbx
mov    %rsp,%rax
lea    0xf(,%rdi,4),%rcx
and    $0xfffffffffffffff0,%rcx
sub    %rcx,%rax
mov    %rax,%rsp
mov    %rax,%rdi
call   1030 <f0@plt>
mov    %rbx,%rsp
lea    -0x8(%rbp),%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @f2(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i64
store i64 %0, i64* %2
%5 = load i64, i64* %2
%6 = icmp ule i64 %5, 11
br i1 %6, label %7, label %13
7: ; preds = %1
%8 = load i64, i64* %2
%9 = call i8* @llvm.stacksave()
store i8* %9, i8** %3
%10 = alloca i32, i64 %8
store i64 %8, i64* %4
%11 = call i32 @f0(i32* %10)
%12 = load i8*, i8** %3
br label %13
13: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
define void @f2(i64 %0) {
%2 = icmp ult i64 %0, 12
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = tail call i8* @llvm.stacksave()
%5 = alloca i32, i64 %0
%6 = call i32 @f0(i32* %5)
br label %7
7: ; preds = %3, %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ write_wave(int /*<<< orphan*/ *, double, double);
void write_end(FILE *wavfile) { write_wave(wavfile, 1.0, 2272.0); }


x86 assembly (clang, -O0):
<write_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
movsd  0xed8(%rip),%xmm0
movsd  0xed8(%rip),%xmm1
call   1030 <write_wave@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_end>:
movsd  0xee8(%rip),%xmm0
movsd  0xee8(%rip),%xmm1
jmp    1030 <write_wave@plt>

LLVM IR (-O0):
define void @write_end(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @write_wave(i32* %3, double 1.000000e+00, double 2.272000e+03)
ret void
}

LLVM IR (-O2):
define void @write_end(i32* %0) {
%2 = tail call i32 @write_wave(i32* %0, double 1.000000e+00, double 2.272000e+03)
ret void
}
/* Variables and functions */
long rand();
long toku_random_long(void) {
  long r1, r2;
  r1 = rand();
  r2 = rand();
  return r1 | (r2 << 32);
}


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

x86 assembly (clang, -O2):
<toku_random_long>:
push   %rbx
xor    %eax,%eax
call   1030 <rand@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <rand@plt>
shl    $0x20,%rax
or     %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @toku_random_long() {
%1 = alloca i64
%2 = alloca i64
%3 = call i64 (...) @rand()
store i64 %3, i64* %1
%4 = call i64 (...) @rand()
store i64 %4, i64* %2
%5 = load i64, i64* %1
%6 = load i64, i64* %2
%7 = shl i64 %6, 32
%8 = or i64 %5, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @toku_random_long() {
%1 = tail call i64 (...) @rand()
%2 = tail call i64 (...) @rand()
%3 = shl i64 %2, 32
%4 = or i64 %3, %1
ret i64 %4
}
/* Variables and functions */
char *mktemp(char *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void generate_scratch_filename(char *fn, char *extension) {
  char template[] = "SCR_XXXXXX";
  char *cp;
  cp = mktemp(template);
  strcpy(fn, cp);
  strcat(fn, ".");
  strcat(fn, extension);
}


x86 assembly (clang, -O0):
<generate_scratch_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xeb9(%rip),%rax
mov    %rax,-0x1b(%rbp)
mov    0xeb6(%rip),%ax
mov    %ax,-0x13(%rbp)
mov    0xeae(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x1b(%rbp),%rdi
call   1050 <mktemp@plt>
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_scratch_filename>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movabs $0x585858585f524353,%rax
58 58 58
mov    %rax,0x8(%rsp)
movl   $0x585858,0xf(%rsp)
lea    0x8(%rsp),%rdi
call   1050 <mktemp@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcpy@plt>
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcat@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.generate_scratch_filename.template = [11 x i8] c"SCR_XXXXXX\00"
@.str = [2 x i8] c".\00"
define void @generate_scratch_filename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [11 x i8]
%6 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = bitcast [11 x i8]* %5 to i8*
%8 = getelementptr inbounds [11 x i8], [11 x i8]* %5, i64 0, i64 0
%9 = call i8* @mktemp(i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %3
%11 = load i8*, i8** %6
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = load i8*, i8** %3
%16 = load i8*, i8** %4
%17 = call i32 @strcat(i8* %15, i8* %16)
ret void
}

LLVM IR (-O2):
@__const.generate_scratch_filename.template = [11 x i8] c"SCR_XXXXXX\00"
@.str = [2 x i8] c".\00"
define void @generate_scratch_filename(i8* %0, i8* %1) {
%3 = alloca [11 x i8]
%4 = getelementptr inbounds [11 x i8], [11 x i8]* %3, i64 0, i64 0
%5 = call i8* @mktemp(i8* %4)
%6 = call i32 @strcpy(i8* %0, i8* %5)
%7 = call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @strcat(i8* %0, i8* %1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
uid_t geteuid(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @geteuid() {
ret i32 0
}
void do_rm(argc, argv) char **argv;
{
  while (argc-- > 1) {
    if (unlink(argv[1]) < 0)
      perror(argv[1]);
    argv++;
  }
}


x86 assembly (clang, -O0):
<do_rm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x1,%eax
jle    117b <do_rm+0x5b>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1030 <unlink@plt>
cmp    $0x0,%eax
jge    116a <do_rm+0x4a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1040 <perror@plt>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <do_rm+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_rm>:
push   %rbp
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     1166 <do_rm+0x46>
mov    %rsi,%rbx
mov    %edi,%ebp
add    $0x1,%ebp
add    $0x8,%rbx
jmp    114c <do_rm+0x2c>
cs nopw 0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
add    $0x8,%rbx
cmp    $0x2,%ebp
jbe    1166 <do_rm+0x46>
mov    (%rbx),%rdi
xor    %eax,%eax
call   1030 <unlink@plt>
test   %eax,%eax
jns    1140 <do_rm+0x20>
mov    (%rbx),%rdi
xor    %eax,%eax
call   1040 <perror@plt>
jmp    1140 <do_rm+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @do_rm(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
br label %5
5: ; preds = %20, %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, -1
store i32 %7, i32* %3
%8 = icmp sgt i32 %6, 1
br i1 %8, label %9, label %23
9: ; preds = %5
%10 = load i8**, i8*** %4
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %12)
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %20
15: ; preds = %9
%16 = load i8**, i8*** %4
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %18)
br label %20
20: ; preds = %15, %9
%21 = load i8**, i8*** %4
%22 = getelementptr inbounds i8*, i8** %21, i32 1
store i8** %22, i8*** %4
br label %5
23: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @do_rm(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %17
4: ; preds = %2, %15
%5 = phi i32 [ %7, %15 ], [ %0, %2 ]
%6 = phi i8** [ %8, %15 ], [ %1, %2 ]
%7 = add nsw i32 %5, -1
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @unlink to i32 (i8*, ...)*)(i8* %9)
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i8*, i8** %8
%14 = tail call i32 (i8*, ...) bitcast (i32 (...)* @perror to i32 (i8*, ...)*)(i8* %13)
br label %15
15: ; preds = %12, %4
%16 = icmp ugt i32 %5, 2
br i1 %16, label %4, label %17
17: ; preds = %15, %2
ret void
}
int autogroup_path(struct task_group *tg, char *buf, int buflen) { return 0; }


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

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

LLVM IR (-O0):
%struct.task_group = type opaque
define i32 @autogroup_path(%struct.task_group* %0, i8* %1, i32 %2) {
%4 = alloca %struct.task_group*
%5 = alloca i8*
%6 = alloca i32
store %struct.task_group* %0, %struct.task_group** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.task_group = type opaque
define i32 @autogroup_path(%struct.task_group* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Existentialism.\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Existentialism.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = 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*/ printf(char *);
int pa_log_level_meta() {
  printf("NOT IMPLEMENTED:"
         "pa_log_level_meta"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [34 x i8] c"NOT IMPLEMENTED:pa_log_level_meta\00"
define i32 @pa_log_level_meta() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ULA32(int codigoOperacao) {
  printf("ULA32 não foi implementada!\n");
  return;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"ULA32 n\C3\A3o foi implementada!\0A\00"
define void @ULA32(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [29 x i8] c"ULA32 n\C3\A3o foi implementada!\00"
define void @ULA32(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ binary_dump_field(int, int, int /*<<< orphan*/,
                                     int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int binary_dump_end(int fd) {
  binary_dump_field(fd, 1, 0, 0);
  close(fd);
  return 1;
}


x86 assembly (clang, -O0):
<binary_dump_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <binary_dump_field@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary_dump_end>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%esi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <binary_dump_field@plt>
mov    %ebx,%edi
call   1040 <close@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @binary_dump_end(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @binary_dump_field(i32 %3, i32 1, i32 0, i32 0)
%5 = load i32, i32* %2
%6 = call i32 @close(i32 %5)
ret i32 1
}

LLVM IR (-O2):
define i32 @binary_dump_end(i32 %0) {
%2 = tail call i32 @binary_dump_field(i32 %0, i32 1, i32 0, i32 0)
%3 = tail call i32 @close(i32 %0)
ret i32 1
}