xunge/DecIR huggingface dataset:
/* Type definitions */
struct Vector_T {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_Vector_T_tol(struct Vector_T const *const, double);
void print_Vector_T(const struct Vector_T *const a) {
  print_Vector_T_tol(a, 1.0e-15);
}


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

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

LLVM IR (-O0):
%struct.Vector_T = type { i32 }
define void @print_Vector_T(%struct.Vector_T* %0) {
%2 = alloca %struct.Vector_T*
store %struct.Vector_T* %0, %struct.Vector_T** %2
%3 = load %struct.Vector_T*, %struct.Vector_T** %2
%4 = call i32 @print_Vector_T_tol(%struct.Vector_T* %3, double 1.000000e-15)
ret void
}

LLVM IR (-O2):
%struct.Vector_T = type { i32 }
define void @print_Vector_T(%struct.Vector_T* %0) {
%2 = tail call i32 @print_Vector_T_tol(%struct.Vector_T* %0, double 1.000000e-15)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int readByte(int);
int /*<<< orphan*/ writeByte(int, int);
void digitalWritePiFaceSpecial(int pin, int value) {
  uint8_t mask = 1 << pin;
  uint8_t old;
  old = readByte(0x12);
  if (value == 0)
    old &= (~mask);
  else
    old |= mask;
  writeByte(0x12, old);
}


x86 assembly (clang, -O0):
<digitalWritePiFaceSpecial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    $0x12,%edi
call   1030 <readByte@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1163 <digitalWritePiFaceSpecial+0x43>
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116c <digitalWritePiFaceSpecial+0x4c>
mov    -0xc(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
mov    $0x12,%edi
call   1040 <writeByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digitalWritePiFaceSpecial>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x12,%edi
call   1030 <readByte@plt>
mov    %eax,%esi
btr    %ebp,%esi
bts    %ebp,%eax
test   %ebx,%ebx
cmovne %eax,%esi
mov    $0x12,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <writeByte@plt>

LLVM IR (-O0):
define void @digitalWritePiFaceSpecial(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = shl i32 1, %7
store i32 %8, i32* %5
%9 = call i32 @readByte(i32 18)
store i32 %9, i32* %6
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %2
%13 = load i32, i32* %5
%14 = xor i32 %13, -1
%15 = load i32, i32* %6
%16 = and i32 %15, %14
store i32 %16, i32* %6
br label %21
17: ; preds = %2
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = or i32 %19, %18
store i32 %20, i32* %6
br label %21
21: ; preds = %17, %12
%22 = load i32, i32* %6
%23 = call i32 @writeByte(i32 18, i32 %22)
ret void
}

LLVM IR (-O2):
define void @digitalWritePiFaceSpecial(i32 %0, i32 %1) {
%3 = shl nuw i32 1, %0
%4 = tail call i32 @readByte(i32 18)
%5 = icmp eq i32 %1, 0
%6 = xor i32 %3, -1
%7 = and i32 %4, %6
%8 = or i32 %4, %3
%9 = select i1 %5, i32 %7, i32 %8
%10 = tail call i32 @writeByte(i32 18, i32 %9)
ret void
}
int open_input_state(char *filename) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @open_input_state(i8* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ set_port(int /*<<< orphan*/, int /*<<< orphan*/,
                            int /*<<< orphan*/, int, int);
void set_interrupt_defaults(uint8_t address, uint8_t port, uint8_t value) {
  set_port(address, port, value, 0x06, 0x07);
}


x86 assembly (clang, -O0):
<set_interrupt_defaults>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    $0x6,%ecx
mov    $0x7,%r8d
call   1030 <set_port@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_interrupt_defaults>:
mov    $0x6,%ecx
mov    $0x7,%r8d
jmp    1030 <set_port@plt>

LLVM IR (-O0):
define void @set_interrupt_defaults(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @set_port(i32 %7, i32 %8, i32 %9, i32 6, i32 7)
ret void
}

LLVM IR (-O2):
define void @set_interrupt_defaults(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @set_port(i32 %0, i32 %1, i32 %2, i32 6, i32 7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dump_stuff_mmx(void *, unsigned int, unsigned int);
int /*<<< orphan*/ printf(char *, char *);
void dump_stuff_mmx_msg(const void *msg, void *buf, unsigned int size,
                        unsigned int index) {
  printf("%s : ", (char *)msg);
  dump_stuff_mmx(buf, size, index);
}


x86 assembly (clang, -O0):
<dump_stuff_mmx_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <dump_stuff_mmx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_stuff_mmx_msg>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xeca(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <dump_stuff_mmx@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s : \00"
define void @dump_stuff_mmx_msg(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0)
%6 = tail call i32 @dump_stuff_mmx(i8* %1, i32 %2, i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main() {
  char dest_string[50];
  char source_string[] = "Are we not men?";
  strncpy(dest_string, source_string, 6);
  printf("%s\n", dest_string);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x6,%edx
call   1030 <strncpy@plt>
lea    -0x40(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x50,%rsp
movaps 0xed4(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x10(%rsp),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1030 <strncpy@plt>
lea    0xec4(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.source_string = [16 x i8] c"Are we not men?\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca [16 x i8]
store i32 0, i32* %1
%4 = bitcast [16 x i8]* %3 to i8*
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %3, i64 0, i64 0
%7 = call i32 @strncpy(i8* %5, i8* %6, i32 6)
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.source_string = [16 x i8] c"Are we not men?\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca [16 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%5 = call i32 @strncpy(i8* %3, i8* %4, i32 6)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
/* Type definitions */
struct service {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void destroy_service(struct service **s) {
  if (*s == NULL) {
    return;
  }
  free((void *)*s);
  *s = NULL;
}


x86 assembly (clang, -O0):
<destroy_service>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
jne    112f <destroy_service+0x1f>
jmp    1146 <destroy_service+0x36>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<destroy_service>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1128 <destroy_service+0x18>
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
%struct.service = type { i32 }
define void @destroy_service(%struct.service** %0) {
%2 = alloca %struct.service**
store %struct.service** %0, %struct.service*** %2
%3 = load %struct.service**, %struct.service*** %2
%4 = load %struct.service*, %struct.service** %3
%5 = icmp eq %struct.service* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
br label %13
7: ; preds = %1
%8 = load %struct.service**, %struct.service*** %2
%9 = load %struct.service*, %struct.service** %8
%10 = bitcast %struct.service* %9 to i8*
%11 = call i32 @free(i8* %10)
%12 = load %struct.service**, %struct.service*** %2
store %struct.service* null, %struct.service** %12
br label %13
13: ; preds = %7, %6
ret void
}

LLVM IR (-O2):
%struct.service = type { i32 }
define void @destroy_service(%struct.service** nocapture %0) {
%2 = load %struct.service*, %struct.service** %0
%3 = icmp eq %struct.service* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = bitcast %struct.service* %2 to i8*
%6 = tail call i32 @free(i8* %5)
store %struct.service* null, %struct.service** %0
br label %7
7: ; preds = %1, %4
ret void
}
/* Variables and functions */
int pow(int, int);
unsigned int invert(unsigned int x, int p, int n) {
  int bits;
  unsigned int y;
  bits = sizeof(int) * 8;
  y = (int)(pow(2, n) - 1) << (bits - p - n);
  x = ~y & x | (~x & y);
  return x;
}


x86 assembly (clang, -O0):
<invert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x20,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x2,%edi
call   1030 <pow@plt>
sub    $0x1,%eax
mov    -0x10(%rbp),%ecx
sub    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0x14(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<invert>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r14d
mov    $0x2,%edi
mov    %edx,%esi
call   1030 <pow@plt>
add    $0xffffffff,%eax
add    %ebx,%ebp
neg    %bpl
mov    %ebp,%ecx
shl    %cl,%eax
xor    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 32, i32* %7
%9 = load i32, i32* %6
%10 = call i32 @pow(i32 2, i32 %9)
%11 = sub nsw i32 %10, 1
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = sub nsw i32 %12, %13
%15 = load i32, i32* %6
%16 = sub nsw i32 %14, %15
%17 = shl i32 %11, %16
store i32 %17, i32* %8
%18 = load i32, i32* %8
%19 = xor i32 %18, -1
%20 = load i32, i32* %4
%21 = and i32 %19, %20
%22 = load i32, i32* %4
%23 = xor i32 %22, -1
%24 = load i32, i32* %8
%25 = and i32 %23, %24
%26 = or i32 %21, %25
store i32 %26, i32* %4
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
define i32 @invert(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @pow(i32 2, i32 %2)
%5 = add nsw i32 %4, -1
%6 = add i32 %1, %2
%7 = sub i32 32, %6
%8 = shl i32 %5, %7
%9 = xor i32 %8, %0
ret i32 %9
}
char *strDelete1stCh(char *st) {
  int i = 0;
  if (st[0] != 0) {
    do {
      i++;
      st[i - 1] = st[i];
    } while (st[i]);
  }
  return st;
}


x86 assembly (clang, -O0):
<strDelete1stCh>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115f <strDelete1stCh+0x5f>
jmp    1124 <strDelete1stCh+0x24>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
jne    1124 <strDelete1stCh+0x24>
jmp    115f <strDelete1stCh+0x5f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strDelete1stCh>:
mov    %rdi,%rax
cmpb   $0x0,(%rdi)
je     111e <strDelete1stCh+0x1e>
lea    0x1(%rax),%rcx
nopl   0x0(%rax)
movzbl (%rcx),%edx
mov    %dl,-0x1(%rcx)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strDelete1stCh+0x10>
ret

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

LLVM IR (-O2):
define i8* @strDelete1stCh(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %6, %4 ], [ 0, %1 ]
%6 = add nuw nsw i64 %5, 1
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %0, i64 %5
store i8 %8, i8* %9
%10 = icmp eq i8 %8, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret i8* %0
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
scalar_t__ diminuto_fd_readable_generic(int, int);
ssize_t diminuto_fd_valid(int fd) {
  return (diminuto_fd_readable_generic(fd, !0) >= 0);
}


x86 assembly (clang, -O0):
<diminuto_fd_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
call   1030 <diminuto_fd_readable_generic@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diminuto_fd_valid>:
push   %rax
mov    $0x1,%esi
call   1030 <diminuto_fd_readable_generic@plt>
shr    $0x3f,%rax
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @diminuto_fd_valid(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @diminuto_fd_readable_generic(i32 %3, i32 1)
%5 = icmp sge i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @diminuto_fd_valid(i32 %0) {
%2 = tail call i64 @diminuto_fd_readable_generic(i32 %0, i32 1)
%3 = lshr i64 %2, 63
%4 = trunc i64 %3 to i32
%5 = xor i32 %4, 1
ret i32 %5
}
long main() {
  char a;
  char *f;
  long m;
  a = 'k';
  f = &a;
  m = f;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movb   $0x6b,-0x9(%rbp)
lea    -0x9(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @main() {
ret i64 undef
}
/* Variables and functions */
int make_server_socet_q(int, int);
int make_server_socket(int portnum) { return make_server_socet_q(portnum, 1); }


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

x86 assembly (clang, -O2):
<make_server_socket>:
mov    $0x1,%esi
jmp    1030 <make_server_socet_q@plt>

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

LLVM IR (-O2):
define i32 @make_server_socket(i32 %0) {
%2 = tail call i32 @make_server_socet_q(i32 %0, i32 1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void SampleMenu(int menuID) {
  printf("SampleMenu() callback executed, menuID is %i\n", menuID);
}


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

x86 assembly (clang, -O2):
<SampleMenu>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [46 x i8] c"SampleMenu() callback executed, menuID is %i\0A\00"
define void @SampleMenu(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"SampleMenu() callback executed, menuID is %i\0A\00"
define void @SampleMenu(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
int xmlUCSIsMalayalam(int code) {
  return (((code >= 0x0D00) && (code <= 0x0D7F)));
}


x86 assembly (clang, -O0):
<xmlUCSIsMalayalam>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0xd00,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1126 <xmlUCSIsMalayalam+0x26>
cmpl   $0xd7f,-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):
<xmlUCSIsMalayalam>:
and    $0xffffff80,%edi
xor    %eax,%eax
cmp    $0xd00,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @xmlUCSIsMalayalam(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 3328
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 3455
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 @xmlUCSIsMalayalam(i32 %0) {
%2 = and i32 %0, -128
%3 = icmp eq i32 %2, 3328
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, char const *);
void *strdup(char const *);
void *rrp_strdup(const char *string) {
  void *p = strdup(string);
  if (!p)
    die("Could not duplicate %s\n", string);
  return p;
}


x86 assembly (clang, -O0):
<rrp_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <rrp_strdup+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <die@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rrp_strdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strdup@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <rrp_strdup+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <die@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Could not duplicate %s\0A\00"
define i8* @rrp_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strdup(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [24 x i8] c"Could not duplicate %s\0A\00"
define noalias i8* @rrp_strdup(i8* %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__1__IO__set();
void LedsP__Led1__set(void) { HplAtm128GeneralIOPinP__1__IO__set(); }


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

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

LLVM IR (-O0):
define void @LedsP__Led1__set() {
%1 = call i32 (...) @HplAtm128GeneralIOPinP__1__IO__set()
ret void
}

LLVM IR (-O2):
define void @LedsP__Led1__set() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__1__IO__set()
ret void
}
/* Variables and functions */
float atan(float);
float Float_atan(float x) { return atan(x); }


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

x86 assembly (clang, -O2):
<Float_atan>:
jmp    1030 <atan@plt>

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

LLVM IR (-O2):
define float @Float_atan(float %0) {
%2 = tail call float @atan(float %0)
ret float %2
}
/* Variables and functions */
int test(unsigned char *, int);
int is_c(unsigned char *seq, int n) {
  int ndx = n * 2;
  if (test(seq, ndx) == 1 || test(seq, ndx + 1) == 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   1030 <test@plt>
cmp    $0x1,%eax
je     1155 <is_c+0x45>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
add    $0x1,%esi
call   1030 <test@plt>
cmp    $0x0,%eax
jne    1161 <is_c+0x51>
movl   $0x0,-0x4(%rbp)
jmp    1168 <is_c+0x58>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_c>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
add    %esi,%ebx
mov    %ebx,%esi
call   1030 <test@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
je     1141 <is_c+0x31>
or     $0x1,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <test@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @is_c(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 1
%4 = tail call i32 @test(i8* %0, i32 %3)
%5 = icmp eq i32 %4, 1
br i1 %5, label %11, label %6
6: ; preds = %2
%7 = or i32 %3, 1
%8 = tail call i32 @test(i8* %0, i32 %7)
%9 = icmp ne i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %6, %2
%12 = phi i32 [ 0, %2 ], [ %10, %6 ]
ret i32 %12
}
/* Variables and functions */
int dlclose(void *);
int SEC_OSAL_dlclose(void *handle) { return dlclose(handle); }


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

x86 assembly (clang, -O2):
<SEC_OSAL_dlclose>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define i32 @SEC_OSAL_dlclose(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret i32 %2
}
int test_imm_D9int64_highword_reg(long long val) {
  return ((val >> 32) & (0xD9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D9int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 217
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_D9int64_highword_reg(i64 %0) {
%2 = and i64 %0, 932007903232
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
void action_free(struct page_ctx *ctx, const struct page *page) {}


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

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

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

LLVM IR (-O2):
%struct.page_ctx = type opaque
%struct.page = type opaque
define void @action_free(%struct.page_ctx* nocapture %0, %struct.page* nocapture %1) {
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ lprintf(char *);
int /*<<< orphan*/ stderr;
int system(char *);
void start_bash(void) {
  int ret;
  fprintf(stderr, "Starting bash shell -- type exit to continue\n");
  ret = system("/bin/bash");
  if (ret != EXIT_SUCCESS)
    lprintf("bash returned an error");
}


x86 assembly (clang, -O0):
<start_bash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xeda(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2e72(%rip),%rcx
cmp    (%rcx),%eax
je     117a <start_bash+0x4a>
lea    0xec3(%rip),%rdi
call   1050 <lprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_bash>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
lea    0xee1(%rip),%rdi
call   1030 <system@plt>
mov    0x2e7f(%rip),%rcx
cmp    (%rcx),%eax
jne    115f <start_bash+0x2f>
pop    %rax
ret
lea    0xed2(%rip),%rdi
pop    %rax
jmp    1050 <lprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"Starting bash shell -- type exit to continue\0A\00"
@.str.1 = [10 x i8] c"/bin/bash\00"
@EXIT_SUCCESS = global i32 0
@.str.2 = [23 x i8] c"bash returned an error\00"
define void @start_bash() {
%1 = alloca i32
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = load i32, i32* @EXIT_SUCCESS
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @lprintf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"Starting bash shell -- type exit to continue\0A\00"
@.str.1 = [10 x i8] c"/bin/bash\00"
@EXIT_SUCCESS = global i32 0
@.str.2 = [23 x i8] c"bash returned an error\00"
define void @start_bash() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @system(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%4 = load i32, i32* @EXIT_SUCCESS
%5 = icmp eq i32 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %0
%7 = tail call i32 @lprintf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UI_DEV_DESTROY;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ioctl(int, int /*<<< orphan*/);
void evf_uinput_destroy(int fd) {
  ioctl(fd, UI_DEV_DESTROY);
  close(fd);
}


x86 assembly (clang, -O0):
<evf_uinput_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb3(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    -0x4(%rbp),%edi
call   1040 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<evf_uinput_destroy>:
push   %rbx
mov    %edi,%ebx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <close@plt>

LLVM IR (-O0):
@UI_DEV_DESTROY = global i32 0
define void @evf_uinput_destroy(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @UI_DEV_DESTROY
%5 = call i32 @ioctl(i32 %3, i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
ret void
}

LLVM IR (-O2):
@UI_DEV_DESTROY = global i32 0
define void @evf_uinput_destroy(i32 %0) {
%2 = load i32, i32* @UI_DEV_DESTROY
%3 = tail call i32 @ioctl(i32 %0, i32 %2)
%4 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
float sqrtf(float const);
float VectorMagnitude(const float v[3]) {
  return (sqrtf(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]));
}


x86 assembly (clang, -O0):
<VectorMagnitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm0
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrtf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VectorMagnitude>:
movss  (%rdi),%xmm1
movss  0x4(%rdi),%xmm0
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0x8(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jb     113f <VectorMagnitude+0x2f>
sqrtss %xmm0,%xmm0
ret
jmp    1030 <sqrtf@plt>

LLVM IR (-O0):
define float @VectorMagnitude(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %16)
%24 = call float @sqrtf(float %23)
ret float %24
}

LLVM IR (-O2):
define float @VectorMagnitude(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = tail call float @sqrtf(float %9)
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ popNarray(char *, unsigned int);
void poppointer4array(void *x, int n) {
  popNarray((char *)x, (unsigned int)(n * 4));
}


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

x86 assembly (clang, -O2):
<poppointer4array>:
shl    $0x2,%esi
jmp    1030 <popNarray@plt>

LLVM IR (-O0):
define void @poppointer4array(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 = mul nsw i32 %6, 4
%8 = call i32 @popNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @poppointer4array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = tail call i32 @popNarray(i8* %0, i32 %3)
ret void
}
void AS1_OnTxChar(void) {}


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

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

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

LLVM IR (-O2):
define void @AS1_OnTxChar() {
ret void
}
int fun1380() { return 1380; }


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

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

LLVM IR (-O0):
define i32 @fun1380() {
ret i32 1380
}

LLVM IR (-O2):
define i32 @fun1380() {
ret i32 1380
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
char *format(int number) {
  char *retorno, ret[100];
  int i;
  if (number < 10) {
    sprintf(ret, "0%d", number);
    retorno = ret;
    return retorno;
  } else {
    sprintf(ret, "%d", number);
    retorno = ret;
    return retorno;
  }
}


x86 assembly (clang, -O0):
<format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1150 <format+0x40>
lea    -0x80(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xeca(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x80(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1173 <format+0x63>
lea    -0x80(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xea3(%rip),%rsi
call   1030 <sprintf@plt>
lea    -0x80(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format>:
push   %rbx
sub    $0x70,%rsp
mov    %edi,%edx
cmp    $0xa,%edi
lea    0xedf(%rip),%rax
lea    0xed9(%rip),%rsi
cmovl  %rax,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
add    $0x70,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"0%d\00"
@.str.1 = [3 x i8] c"%d\00"
define noalias i8* @format(i32 %0) {
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%4 = icmp slt i32 %0, 10
%5 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%6 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) %5, i32 %0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__37__IO__makeOutput();
void Msp430GpioC__8__HplGeneralIO__makeOutput(void) {
  HplMsp430GeneralIOP__37__IO__makeOutput();
}


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

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

LLVM IR (-O0):
define void @Msp430GpioC__8__HplGeneralIO__makeOutput() {
%1 = call i32 (...) @HplMsp430GeneralIOP__37__IO__makeOutput()
ret void
}

LLVM IR (-O2):
define void @Msp430GpioC__8__HplGeneralIO__makeOutput() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__37__IO__makeOutput()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void handler_not_defined(unsigned int num) {
  printf("Handler %d not defined\r\n", num);
}


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

x86 assembly (clang, -O2):
<handler_not_defined>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Handler %d not defined\0D\0A\00"
define void @handler_not_defined(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Handler %d not defined\0D\0A\00"
define void @handler_not_defined(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ create_letter_distribution_diagram(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char izrechenie[1000];
  scanf("%[^\n]s", izrechenie);
  create_letter_distribution_diagram(izrechenie);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rsi
lea    0xec0(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x3f0(%rbp),%rdi
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x3f0,%rsp
lea    0xed1(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1030 <create_letter_distribution_diagram@plt>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"%[^\0A]s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @create_letter_distribution_diagram(i8* %2)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int values_not_equal_display_error(int /*<<< orphan*/ const,
                                   int /*<<< orphan*/ const);
int check_not_value(const uint64_t value, const uint64_t check_value_data) {
  return values_not_equal_display_error(value, check_value_data);
}


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

x86 assembly (clang, -O2):
<check_not_value>:
jmp    1030 <values_not_equal_display_error@plt>

LLVM IR (-O0):
define i32 @check_not_value(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 @values_not_equal_display_error(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @check_not_value(i32 %0, i32 %1) {
%3 = tail call i32 @values_not_equal_display_error(i32 %0, i32 %1)
ret i32 %3
}
int usb_round_up_to_mps(int num_bytes, int mps) {
  if (num_bytes < 0 || mps < 0) {
    return 0;
  }
  return ((num_bytes + mps - 1) / mps) * mps;
}


x86 assembly (clang, -O0):
<usb_round_up_to_mps>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     111e <usb_round_up_to_mps+0x1e>
cmpl   $0x0,-0xc(%rbp)
jge    112a <usb_round_up_to_mps+0x2a>
movl   $0x0,-0x4(%rbp)
jmp    113e <usb_round_up_to_mps+0x3e>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0xc(%rbp)
imul   -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_round_up_to_mps>:
mov    %esi,%eax
or     %edi,%eax
js     1116 <usb_round_up_to_mps+0x16>
lea    (%rdi,%rsi,1),%ecx
add    $0xffffffff,%ecx
mov    %ecx,%eax
cltd
idiv   %esi
sub    %edx,%ecx
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @usb_round_up_to_mps(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp sgt i32 %3, -1
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = add i32 %0, -1
%7 = add i32 %6, %1
%8 = srem i32 %7, %1
%9 = sub i32 %7, %8
br label %10
10: ; preds = %2, %5
%11 = phi i32 [ %9, %5 ], [ 0, %2 ]
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ rotl64(int /*<<< orphan*/, int);
uint64_t bmw_large_r1(uint64_t x) {
  uint64_t r;
  r = rotl64(x, 5);
  return r;
}


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

x86 assembly (clang, -O2):
<bmw_large_r1>:
mov    $0x5,%esi
jmp    1030 <rotl64@plt>

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

LLVM IR (-O2):
define i32 @bmw_large_r1(i32 %0) {
%2 = tail call i32 @rotl64(i32 %0, i32 5)
ret i32 %2
}