xunge/DecIR huggingface dataset:
unsigned int hash(const char *str) {
  unsigned int hash = 5381;
  int c;
  while ((c = *str++) != 0)
    hash = ((hash << 5) + hash) + c;
  return (hash % (1 << 8));
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x0,%eax
je     1141 <hash+0x41>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
and    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112b <hash+0x2b>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
movzbl %cl,%ecx
mov    %eax,%edx
shl    $0x5,%edx
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
movzbl %al,%eax
ret
mov    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 5381, i32* %3
br label %5
5: ; preds = %11, %1
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i32 1
store i8* %7, i8** %2
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
store i32 %9, i32* %4
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %5
%12 = load i32, i32* %3
%13 = shl i32 %12, 5
%14 = load i32, i32* %3
%15 = add i32 %13, %14
%16 = load i32, i32* %4
%17 = add i32 %15, %16
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = load i32, i32* %3
%20 = urem i32 %19, 256
ret i32 %20
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %9, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = zext i8 %5 to i32
%9 = getelementptr inbounds i8, i8* %6, i64 1
%10 = mul i32 %7, 33
%11 = add i32 %10, %8
%12 = load i8, i8* %9
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %11, 255
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 5, %1 ], [ %15, %14 ]
ret i32 %17
}
char letraCoeficiente(int pos) {
  char letra;
  if (pos == 0) {
    letra = 'i';
  } else if (pos == 1) {
    letra = 'j';
  } else if (pos == 2) {
    letra = 'k';
  }
  return letra;
}


x86 assembly (clang, -O0):
<letraCoeficiente>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111a <letraCoeficiente+0x1a>
movb   $0x69,-0x5(%rbp)
jmp    1145 <letraCoeficiente+0x45>
cmpl   $0x1,-0x4(%rbp)
jne    112d <letraCoeficiente+0x2d>
movb   $0x6a,-0x5(%rbp)
jmp    1140 <letraCoeficiente+0x40>
cmpl   $0x2,-0x4(%rbp)
jne    113b <letraCoeficiente+0x3b>
movb   $0x6b,-0x5(%rbp)
jmp    1140 <letraCoeficiente+0x40>
jmp    1145 <letraCoeficiente+0x45>
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<letraCoeficiente>:
cmp    $0x1,%edi
sete   %al
add    $0x69,%al
cmp    $0x2,%edi
movzbl %al,%ecx
mov    $0x6b,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @letraCoeficiente(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8 105, i8* %3
br label %17
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i8 106, i8* %3
br label %16
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %15
14: ; preds = %11
store i8 107, i8* %3
br label %15
15: ; preds = %14, %11
br label %16
16: ; preds = %15, %10
br label %17
17: ; preds = %16, %6
%18 = load i8, i8* %3
ret i8 %18
}

LLVM IR (-O2):
define signext i8 @letraCoeficiente(i32 %0) {
%2 = icmp eq i32 %0, 1
%3 = select i1 %2, i8 106, i8 105
%4 = icmp eq i32 %0, 2
%5 = select i1 %4, i8 107, i8 %3
ret i8 %5
}
/* Type definitions */
struct wl_shell_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void wl_shell_surface_set_user_data(struct wl_shell_surface *wl_shell_surface,
                                    void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)wl_shell_surface, user_data);
}


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

x86 assembly (clang, -O2):
<wl_shell_surface_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

LLVM IR (-O0):
%struct.wl_shell_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shell_surface_set_user_data(%struct.wl_shell_surface* %0, i8* %1) {
%3 = alloca %struct.wl_shell_surface*
%4 = alloca i8*
store %struct.wl_shell_surface* %0, %struct.wl_shell_surface** %3
store i8* %1, i8** %4
%5 = load %struct.wl_shell_surface*, %struct.wl_shell_surface** %3
%6 = bitcast %struct.wl_shell_surface* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.wl_shell_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shell_surface_set_user_data(%struct.wl_shell_surface* %0, i8* %1) {
%3 = bitcast %struct.wl_shell_surface* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
int media_init() { return 1; }


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

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

LLVM IR (-O0):
define i32 @media_init() {
ret i32 1
}

LLVM IR (-O2):
define i32 @media_init() {
ret i32 1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ _HibernateWriteComplete();
void HibernateTamperExtOscRecover(void) {
  (*((volatile uint32_t *)(0x400FC360))) = 0xA3359554;
  _HibernateWriteComplete();
  (*((volatile uint32_t *)(0x400FC404))) |= 0x00000001;
  _HibernateWriteComplete();
  (*((volatile uint32_t *)(0x400FC360))) = 0;
  _HibernateWriteComplete();
}


x86 assembly (clang, -O0):
<HibernateTamperExtOscRecover>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fc360,%eax
movl   $0xa3359554,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc404,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x400fc404,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
mov    $0x400fc360,%eax
movl   $0x0,(%rax)
mov    $0x0,%al
call   1030 <_HibernateWriteComplete@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HibernateTamperExtOscRecover>:
push   %rax
movl   $0xa3359554,0x400fc360
54 95 35 a3
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
orl    $0x1,0x400fc404
01
xor    %eax,%eax
call   1030 <_HibernateWriteComplete@plt>
movl   $0x0,0x400fc360
xor    %eax,%eax
pop    %rcx
jmp    1030 <_HibernateWriteComplete@plt>

LLVM IR (-O0):
define void @HibernateTamperExtOscRecover() {
store volatile i32 -1556769452, i32* inttoptr (i64 1074774880 to i32*)
%1 = call i32 (...) @_HibernateWriteComplete()
%2 = load volatile i32, i32* inttoptr (i64 1074775044 to i32*)
%3 = or i32 %2, 1
store volatile i32 %3, i32* inttoptr (i64 1074775044 to i32*)
%4 = call i32 (...) @_HibernateWriteComplete()
store volatile i32 0, i32* inttoptr (i64 1074774880 to i32*)
%5 = call i32 (...) @_HibernateWriteComplete()
ret void
}

LLVM IR (-O2):
define void @HibernateTamperExtOscRecover() {
store volatile i32 -1556769452, i32* inttoptr (i64 1074774880 to i32*)
%1 = tail call i32 (...) @_HibernateWriteComplete()
%2 = load volatile i32, i32* inttoptr (i64 1074775044 to i32*)
%3 = or i32 %2, 1
store volatile i32 %3, i32* inttoptr (i64 1074775044 to i32*)
%4 = tail call i32 (...) @_HibernateWriteComplete()
store volatile i32 0, i32* inttoptr (i64 1074774880 to i32*)
%5 = tail call i32 (...) @_HibernateWriteComplete()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ closeInputDevice(int);
int device_close(int fd) { closeInputDevice(fd); }


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

x86 assembly (clang, -O2):
<device_close>:
jmp    1030 <closeInputDevice@plt>

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

LLVM IR (-O2):
define i32 @device_close(i32 %0) {
%2 = tail call i32 @closeInputDevice(i32 %0)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ LoadRegistre(int, unsigned int);
int StoreRegistre(int);
int /*<<< orphan*/ ipc(int, int);
int NewCharacterDeviceInSystem(unsigned permissions) {
  LoadRegistre(0, 5);
  LoadRegistre(1, 5);
  LoadRegistre(2, 0);
  LoadRegistre(3, 0);
  LoadRegistre(4, permissions);
  ipc(3, 5);
  return StoreRegistre(2);
}


x86 assembly (clang, -O0):
<NewCharacterDeviceInSystem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %edi,%edi
mov    $0x5,%esi
call   1030 <LoadRegistre@plt>
mov    $0x1,%edi
mov    $0x5,%esi
call   1030 <LoadRegistre@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <LoadRegistre@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <LoadRegistre@plt>
mov    -0x4(%rbp),%esi
mov    $0x4,%edi
call   1030 <LoadRegistre@plt>
mov    $0x3,%edi
mov    $0x5,%esi
call   1050 <ipc@plt>
mov    $0x2,%edi
call   1040 <StoreRegistre@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NewCharacterDeviceInSystem>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
mov    $0x5,%esi
call   1030 <LoadRegistre@plt>
mov    $0x1,%edi
mov    $0x5,%esi
call   1030 <LoadRegistre@plt>
mov    $0x2,%edi
xor    %esi,%esi
call   1030 <LoadRegistre@plt>
mov    $0x3,%edi
xor    %esi,%esi
call   1030 <LoadRegistre@plt>
mov    $0x4,%edi
mov    %ebx,%esi
call   1030 <LoadRegistre@plt>
mov    $0x3,%edi
mov    $0x5,%esi
call   1050 <ipc@plt>
mov    $0x2,%edi
pop    %rbx
jmp    1040 <StoreRegistre@plt>

LLVM IR (-O0):
define i32 @NewCharacterDeviceInSystem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @LoadRegistre(i32 0, i32 5)
%4 = call i32 @LoadRegistre(i32 1, i32 5)
%5 = call i32 @LoadRegistre(i32 2, i32 0)
%6 = call i32 @LoadRegistre(i32 3, i32 0)
%7 = load i32, i32* %2
%8 = call i32 @LoadRegistre(i32 4, i32 %7)
%9 = call i32 @ipc(i32 3, i32 5)
%10 = call i32 @StoreRegistre(i32 2)
ret i32 %10
}

LLVM IR (-O2):
define i32 @NewCharacterDeviceInSystem(i32 %0) {
%2 = tail call i32 @LoadRegistre(i32 0, i32 5)
%3 = tail call i32 @LoadRegistre(i32 1, i32 5)
%4 = tail call i32 @LoadRegistre(i32 2, i32 0)
%5 = tail call i32 @LoadRegistre(i32 3, i32 0)
%6 = tail call i32 @LoadRegistre(i32 4, i32 %0)
%7 = tail call i32 @ipc(i32 3, i32 5)
%8 = tail call i32 @StoreRegistre(i32 2)
ret i32 %8
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ write_float();
int /*<<< orphan*/ write_zero();
void write_mode(uint8_t mode) {
  if (mode == 0) {
    write_float();
    write_zero();
  } else {
    write_zero();
    write_float();
  }
}


x86 assembly (clang, -O0):
<write_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    114a <write_mode+0x2a>
mov    $0x0,%al
call   1040 <write_float@plt>
mov    $0x0,%al
call   1030 <write_zero@plt>
jmp    1158 <write_mode+0x38>
mov    $0x0,%al
call   1030 <write_zero@plt>
mov    $0x0,%al
call   1040 <write_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_mode>:
push   %rax
xor    %eax,%eax
test   %rdi,%rdi
je     1135 <write_mode+0x15>
call   1030 <write_zero@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <write_float@plt>
call   1040 <write_float@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <write_zero@plt>

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

LLVM IR (-O2):
define void @write_mode(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 (...) @write_float()
%5 = tail call i32 (...) @write_zero()
br label %9
6: ; preds = %1
%7 = tail call i32 (...) @write_zero()
%8 = tail call i32 (...) @write_float()
br label %9
9: ; preds = %6, %3
ret void
}
/* Variables and functions */
unsigned int get_be16();
unsigned int get_be32() {
  unsigned int val;
  val = get_be16() << 16;
  val |= get_be16();
  return val;
}


x86 assembly (clang, -O0):
<get_be32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <get_be16@plt>
shl    $0x10,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <get_be16@plt>
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_be32>:
push   %rbx
xor    %eax,%eax
call   1030 <get_be16@plt>
mov    %eax,%ebx
shl    $0x10,%ebx
xor    %eax,%eax
call   1030 <get_be16@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @get_be32() {
%1 = alloca i32
%2 = call i32 (...) @get_be16()
%3 = shl i32 %2, 16
store i32 %3, i32* %1
%4 = call i32 (...) @get_be16()
%5 = load i32, i32* %1
%6 = or i32 %5, %4
store i32 %6, i32* %1
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_be32() {
%1 = tail call i32 (...) @get_be16()
%2 = shl i32 %1, 16
%3 = tail call i32 (...) @get_be16()
%4 = or i32 %2, %3
ret i32 %4
}
/* Variables and functions */
unsigned long __builtin_aarch64_get_fpsr64();
void fpsr64_getter(void) {
  unsigned long fpsr = __builtin_aarch64_get_fpsr64();
}


x86 assembly (clang, -O0):
<fpsr64_getter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <__builtin_aarch64_get_fpsr64@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @fpsr64_getter() {
%1 = alloca i64
%2 = call i64 (...) @__builtin_aarch64_get_fpsr64()
store i64 %2, i64* %1
ret void
}

LLVM IR (-O2):
define void @fpsr64_getter() {
%1 = tail call i64 (...) @__builtin_aarch64_get_fpsr64()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void rpi_car_stop() {
  printf("### RPi Car Stop ###\n");
  ;
  ;
  ;
  ;
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"### RPi Car Stop ###\0A\00"
define void @rpi_car_stop() {
%1 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [21 x i8] c"### RPi Car Stop ###\00"
define void @rpi_car_stop() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int const_time_is_zero(unsigned int);
unsigned int const_time_eq(unsigned int a, unsigned int b) {
  return const_time_is_zero(a ^ b);
}


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

x86 assembly (clang, -O2):
<const_time_eq>:
xor    %esi,%edi
jmp    1030 <const_time_is_zero@plt>

LLVM IR (-O0):
define i32 @const_time_eq(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 = xor i32 %5, %6
%8 = call i32 @const_time_is_zero(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @const_time_eq(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = tail call i32 @const_time_is_zero(i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void sigurg_handler(int signal) { exit(0); }


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

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

LLVM IR (-O0):
define void @sigurg_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @sigurg_handler(i32 %0) {
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ caddr_t;

/* Variables and functions */
caddr_t _sbrk(int inc) {
  static char *end_of_heap;
  register char *stack asm("sp");
  char *prev_end_of_heap;
  extern char ld_end asm("end");
  if (end_of_heap == 0) {
    end_of_heap = &ld_end;
  }
  if (end_of_heap + inc > stack) {
    return (caddr_t)-1;
  }
  prev_end_of_heap = end_of_heap;
  end_of_heap += inc;
  return (caddr_t)prev_end_of_heap;
}


x86 assembly (clang, -O0):
<_sbrk>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpq   $0x0,0x2f19(%rip)
jne    1123 <_sbrk+0x23>
mov    0x2ec4(%rip),%rax
mov    %rax,0x2f05(%rip)
mov    0x2efe(%rip),%rax
movslq -0x8(%rbp),%rcx
add    %rcx,%rax
cmp    -0x10(%rbp),%rax
jbe    1147 <_sbrk+0x47>
movl   $0xffffffff,-0x4(%rbp)
jmp    1170 <_sbrk+0x70>
mov    0x2eda(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%ecx
mov    0x2ecc(%rip),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,0x2ebf(%rip)
mov    -0x18(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sbrk>:
mov    0x2f21(%rip),%rax
test   %rax,%rax
jne    1113 <_sbrk+0x13>
mov    0x2ecd(%rip),%rax
movslq %edi,%rcx
add    %rax,%rcx
mov    %rcx,0x2f08(%rip)
ret

LLVM IR (-O0):
@_sbrk.end_of_heap = internal global i8* null
@end = external global i8
define i32 @_sbrk(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i32 %0, i32* %3
%6 = load i8*, i8** @_sbrk.end_of_heap
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %9
8: ; preds = %1
store i8* @end, i8** @_sbrk.end_of_heap
br label %9
9: ; preds = %8, %1
%10 = load i8*, i8** @_sbrk.end_of_heap
%11 = load i32, i32* %3
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %10, i64 %12
%14 = load i8*, i8** %4
%15 = icmp ugt i8* %13, %14
br i1 %15, label %16, label %17
16: ; preds = %9
store i32 -1, i32* %2
br label %25
17: ; preds = %9
%18 = load i8*, i8** @_sbrk.end_of_heap
store i8* %18, i8** %5
%19 = load i32, i32* %3
%20 = load i8*, i8** @_sbrk.end_of_heap
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds i8, i8* %20, i64 %21
store i8* %22, i8** @_sbrk.end_of_heap
%23 = load i8*, i8** %5
%24 = ptrtoint i8* %23 to i32
store i32 %24, i32* %2
br label %25
25: ; preds = %17, %16
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@_sbrk.end_of_heap = internal unnamed_addr global i8* null
@end = external global i8
define i32 @_sbrk(i32 %0) {
%2 = load i8*, i8** @_sbrk.end_of_heap
%3 = icmp eq i8* %2, null
%4 = select i1 %3, i8* @end, i8* %2
%5 = sext i32 %0 to i64
%6 = getelementptr inbounds i8, i8* %4, i64 %5
store i8* %6, i8** @_sbrk.end_of_heap
%7 = ptrtoint i8* %4 to i64
%8 = trunc i64 %7 to i32
ret i32 %8
}
/* Variables and functions */
int *bar(float *f) { return f; }


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

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

LLVM IR (-O0):
define i32* @bar(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = bitcast float* %3 to i32*
ret i32* %4
}

LLVM IR (-O2):
define i32* @bar(float* readnone %0) {
%2 = bitcast float* %0 to i32*
ret i32* %2
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double milli_time_d(void) {
  struct timeval tv;
  int h = gettimeofday(&tv, NULL);
  assert(!h);
  return (double)tv.tv_sec + (double)tv.tv_usec * 1e-6;
}


x86 assembly (clang, -O0):
<milli_time_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cvtsi2sdq -0x8(%rbp),%xmm1
cvtsi2sdq -0x10(%rbp),%xmm0
movsd  0xea1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<milli_time_d>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1040 <assert@plt>
cvtsi2sdq 0x10(%rsp),%xmm1
cvtsi2sdq 0x8(%rsp),%xmm0
mulsd  0xead(%rip),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @milli_time_d() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%13 = load i64, i64* %12
%14 = sitofp i64 %13 to double
%15 = call double @llvm.fmuladd.f64(double %14, double 0x3EB0C6F7A0B5ED8D, double %11)
ret double %15
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
define double @milli_time_d() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i64, i64* %7
%9 = sitofp i64 %8 to double
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%11 = load i64, i64* %10
%12 = sitofp i64 %11 to double
%13 = tail call double @llvm.fmuladd.f64(double %12, double 0x3EB0C6F7A0B5ED8D, double %9)
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void pmu_adc_reset_setting() {
  mbus_remote_register_write(
      0x6, 0x3C,
      ((1 << 0) | (1 << 1) | (1 << 2) | (1 << 3) | (1 << 4) | (1 << 5) |
       (1 << 6) | (1 << 7) | (1 << 8) | (1 << 9) | (1 << 10) | (1 << 11) |
       (0 << 12) | (0 << 13) | (1 << 14) | (1 << 15) | (1 << 16) | (1 << 17) |
       (1 << 18) | (1 << 19) | (1 << 20)));
  delay(100);
}


x86 assembly (clang, -O0):
<pmu_adc_reset_setting>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x3c,%esi
mov    $0x1fcfff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_adc_reset_setting>:
push   %rax
mov    $0x6,%edi
mov    $0x3c,%esi
mov    $0x1fcfff,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @pmu_adc_reset_setting() {
%1 = call i32 @mbus_remote_register_write(i32 6, i32 60, i32 2084863)
%2 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @pmu_adc_reset_setting() {
%1 = tail call i32 @mbus_remote_register_write(i32 6, i32 60, i32 2084863)
%2 = tail call i32 @delay(i32 100)
ret void
}
/* Type definitions */
struct thread_info {
  int dummy;
};
struct inferior_list_entry {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct thread_info *);
int /*<<< orphan*/ free_register_cache(int /*<<< orphan*/);
int /*<<< orphan*/ inferior_regcache_data(struct thread_info *);
void free_one_thread(struct inferior_list_entry *inf) {
  struct thread_info *thread = ((struct thread_info *)(inf));
  free_register_cache(inferior_regcache_data(thread));
  free(thread);
}


x86 assembly (clang, -O0):
<free_one_thread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <inferior_regcache_data@plt>
mov    %eax,%edi
call   1050 <free_register_cache@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_one_thread>:
push   %rbx
mov    %rdi,%rbx
call   1040 <inferior_regcache_data@plt>
mov    %eax,%edi
call   1050 <free_register_cache@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.inferior_list_entry = type { i32 }
%struct.thread_info = type { i32 }
define void @free_one_thread(%struct.inferior_list_entry* %0) {
%2 = alloca %struct.inferior_list_entry*
%3 = alloca %struct.thread_info*
store %struct.inferior_list_entry* %0, %struct.inferior_list_entry** %2
%4 = load %struct.inferior_list_entry*, %struct.inferior_list_entry** %2
%5 = bitcast %struct.inferior_list_entry* %4 to %struct.thread_info*
store %struct.thread_info* %5, %struct.thread_info** %3
%6 = load %struct.thread_info*, %struct.thread_info** %3
%7 = call i32 @inferior_regcache_data(%struct.thread_info* %6)
%8 = call i32 @free_register_cache(i32 %7)
%9 = load %struct.thread_info*, %struct.thread_info** %3
%10 = call i32 @free(%struct.thread_info* %9)
ret void
}

LLVM IR (-O2):
%struct.inferior_list_entry = type { i32 }
%struct.thread_info = type { i32 }
define void @free_one_thread(%struct.inferior_list_entry* %0) {
%2 = bitcast %struct.inferior_list_entry* %0 to %struct.thread_info*
%3 = tail call i32 @inferior_regcache_data(%struct.thread_info* %2)
%4 = tail call i32 @free_register_cache(i32 %3)
%5 = tail call i32 @free(%struct.thread_info* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ getattribute(char *, int);
float microfacet_roughness(float Roughness, float DepthScale) {
  if (DepthScale > 1.0) {
    int RayDepth;
    getattribute("path:ray_depth", RayDepth);
    if (RayDepth != 0)
      return Roughness * DepthScale * RayDepth;
  }
  return Roughness;
}


x86 assembly (clang, -O0):
<microfacet_roughness>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xecd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1178 <microfacet_roughness+0x68>
mov    -0x10(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <getattribute@plt>
cmpl   $0x0,-0x10(%rbp)
je     1173 <microfacet_roughness+0x63>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1182 <microfacet_roughness+0x72>
jmp    1178 <microfacet_roughness+0x68>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<microfacet_roughness>:
push   %rax
ucomiss 0xee8(%rip),%xmm1
jbe    1132 <microfacet_roughness+0x22>
lea    0xee3(%rip),%rdi
movss  %xmm0,0x4(%rsp)
call   1030 <getattribute@plt>
movss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [15 x i8] c"path:ray_depth\00"
define float @microfacet_roughness(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i32
store float %0, float* %4
store float %1, float* %5
%7 = load float, float* %5
%8 = fpext float %7 to double
%9 = fcmp ogt double %8, 1.000000e+00
br i1 %9, label %10, label %23
10: ; preds = %2
%11 = load i32, i32* %6
%12 = call i32 @getattribute(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %6
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %10
%16 = load float, float* %4
%17 = load float, float* %5
%18 = fmul float %16, %17
%19 = load i32, i32* %6
%20 = sitofp i32 %19 to float
%21 = fmul float %18, %20
store float %21, float* %3
br label %25
22: ; preds = %10
br label %23
23: ; preds = %22, %2
%24 = load float, float* %4
store float %24, float* %3
br label %25
25: ; preds = %23, %15
%26 = load float, float* %3
ret float %26
}

LLVM IR (-O2):
@.str = [15 x i8] c"path:ray_depth\00"
define float @microfacet_roughness(float returned %0, float %1) {
%3 = fcmp ogt float %1, 1.000000e+00
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @getattribute(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 undef)
br label %6
6: ; preds = %2, %4
ret float %0
}
/* Variables and functions */
int getpid();
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ sleep(int);
int main() {
  int pid;
  pid = getpid();
  printf("My process ID is %d\n", pid);
  sleep(30);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1e,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1e,%edi
call   1050 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"My process ID is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @getpid()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @sleep(i32 30)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"My process ID is %d\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @getpid()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @sleep(i32 30)
ret i32 0
}
void gtk_color_button_get_title() {}


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

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

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

LLVM IR (-O2):
define void @gtk_color_button_get_title() {
ret void
}
void LevelRaiseHack(struct List *L) {}


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

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

LLVM IR (-O0):
%struct.List = type opaque
define void @LevelRaiseHack(%struct.List* %0) {
%2 = alloca %struct.List*
store %struct.List* %0, %struct.List** %2
ret void
}

LLVM IR (-O2):
%struct.List = type opaque
define void @LevelRaiseHack(%struct.List* nocapture %0) {
ret void
}
int countspaces(char s[], int j) {
  int i = 0;
  for (i = 0; s[j - i] == ' '; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<countspaces>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    -0x10(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1146 <countspaces+0x46>
jmp    1138 <countspaces+0x38>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <countspaces+0x19>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<countspaces>:
movslq %esi,%rcx
add    %rdi,%rcx
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
cmpb   $0x20,(%rcx,%rax,1)
lea    -0x1(%rax),%rax
je     1110 <countspaces+0x10>
not    %eax
ret

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

LLVM IR (-O2):
define i32 @countspaces(i8* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %10, %4 ], [ 0, %2 ]
%6 = sub nsw i64 %3, %5
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 32
%10 = add nuw i64 %5, 1
br i1 %9, label %4, label %11
11: ; preds = %4
%12 = trunc i64 %5 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("hello world\n");
  int a;
  a = 9;
  if (a == 4) {
    printf("a is %d\n", a);
  } else {
    a = 5;
  }
  printf("after a is %d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x9,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    1154 <main+0x44>
mov    -0x8(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    115b <main+0x4b>
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
@.str.1 = [9 x i8] c"a is %d\0A\00"
@.str.2 = [15 x i8] c"after a is %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 9, i32* %2
%4 = load i32, i32* %2
%5 = icmp eq i32 %4, 4
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %7)
br label %10
9: ; preds = %0
store i32 5, i32* %2
br label %10
10: ; preds = %9, %6
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [15 x i8] c"after a is %d\0A\00"
@str = [12 x i8] c"hello world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 5)
ret i32 0
}
int foo24() { return 24; }


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

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

LLVM IR (-O0):
define i32 @foo24() {
ret i32 24
}

LLVM IR (-O2):
define i32 @foo24() {
ret i32 24
}
/* Variables and functions */
int syscall(int, int, char const *, char **, char **, int);
int execveat(int fd, const char *path, char **argv, char **envp, int flags) {
  return syscall(322, fd, path, argv, envp, flags);
}


x86 assembly (clang, -O0):
<execveat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x24(%rbp),%r9d
mov    $0x142,%edi
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execveat>:
mov    %r8d,%r9d
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x142,%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
define i32 @execveat(i32 %0, i8* %1, i8** %2, i8** %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8**
%9 = alloca i8**
%10 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i8**, i8*** %8
%14 = load i8**, i8*** %9
%15 = load i32, i32* %10
%16 = call i32 @syscall(i32 322, i32 %11, i8* %12, i8** %13, i8** %14, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @execveat(i32 %0, i8* %1, i8** %2, i8** %3, i32 %4) {
%6 = tail call i32 @syscall(i32 322, i32 %0, i8* %1, i8** %2, i8** %3, i32 %4)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ get_max_line();
int main(int argc, char *argv[]) {
  get_max_line();
  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)
mov    $0x0,%al
call   1030 <get_max_line@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
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 (...) @get_max_line()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @get_max_line()
ret i32 0
}
void ismuchg(float spec, float used, char *flag) {
  if (spec != used)
    *flag = '*';
}


x86 assembly (clang, -O0):
<ismuchg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    112c <ismuchg+0x2c>
jp     112c <ismuchg+0x2c>
jmp    1133 <ismuchg+0x33>
mov    -0x10(%rbp),%rax
movb   $0x2a,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ismuchg>:
ucomiss %xmm1,%xmm0
jne    1107 <ismuchg+0x7>
jnp    110a <ismuchg+0xa>
movb   $0x2a,(%rdi)
ret

LLVM IR (-O0):
define void @ismuchg(float %0, float %1, i8* %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca i8*
store float %0, float* %4
store float %1, float* %5
store i8* %2, i8** %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = fcmp une float %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = load i8*, i8** %6
store i8 42, i8* %11
br label %12
12: ; preds = %10, %3
ret void
}

LLVM IR (-O2):
define void @ismuchg(float %0, float %1, i8* nocapture writeonly %2) {
%4 = fcmp une float %0, %1
br i1 %4, label %5, label %6
5: ; preds = %3
store i8 42, i8* %2
br label %6
6: ; preds = %5, %3
ret void
}
int GetNibbleAddress(int sample) {
  int packets = sample / 14;
  int extraSamples = sample % 14;
  return 16 * packets + extraSamples + 2;
}


x86 assembly (clang, -O0):
<GetNibbleAddress>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xe,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
add    -0xc(%rbp),%eax
add    $0x2,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNibbleAddress>:
movslq %edi,%rax
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x3,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %eax,%esi
lea    (%rdx,%rsi,1),%eax
add    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @GetNibbleAddress(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 14
store i32 %6, i32* %3
%7 = load i32, i32* %2
%8 = srem i32 %7, 14
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = mul nsw i32 16, %9
%11 = load i32, i32* %4
%12 = add nsw i32 %10, %11
%13 = add nsw i32 %12, 2
ret i32 %13
}

LLVM IR (-O2):
define i32 @GetNibbleAddress(i32 %0) {
%2 = sdiv i32 %0, 14
%3 = srem i32 %0, 14
%4 = shl nsw i32 %2, 4
%5 = add nsw i32 %3, 2
%6 = add i32 %5, %4
ret i32 %6
}
void csoundUnLock() {}


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

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

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

LLVM IR (-O2):
define void @csoundUnLock() {
ret void
}
/* Type definitions */
struct game_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ draw(struct game_state *);
int getch();
int /*<<< orphan*/ iterate(struct game_state *);
int /*<<< orphan*/ randomize(struct game_state *);
bool game_step(struct game_state *state) {
  switch (getch()) {
  case 'r':
    randomize(state);
    break;
  case 'q':
    return false;
  }
  iterate(state);
  draw(state);
  return true;
}


x86 assembly (clang, -O0):
<game_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
xor    %eax,%eax
call   1040 <getch@plt>
mov    %eax,%ecx
mov    %ecx,-0x14(%rbp)
sub    $0x71,%eax
je     1185 <game_step+0x45>
jmp    1166 <game_step+0x26>
mov    -0x14(%rbp),%eax
sub    $0x72,%eax
jne    1191 <game_step+0x51>
jmp    1177 <game_step+0x37>
mov    -0x10(%rbp),%rdi
call   1050 <randomize@plt>
jmp    1191 <game_step+0x51>
movl   $0x0,-0x4(%rbp)
jmp    11aa <game_step+0x6a>
mov    -0x10(%rbp),%rdi
call   1060 <iterate@plt>
mov    -0x10(%rbp),%rdi
call   1030 <draw@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<game_step>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <getch@plt>
cmp    $0x71,%eax
je     1176 <game_step+0x36>
cmp    $0x72,%eax
jne    1161 <game_step+0x21>
mov    %rbx,%rdi
call   1050 <randomize@plt>
mov    %rbx,%rdi
call   1060 <iterate@plt>
mov    %rbx,%rdi
call   1030 <draw@plt>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.game_state = type { i32 }
define i32 @game_step(%struct.game_state* %0) {
%2 = alloca i32
%3 = alloca %struct.game_state*
store %struct.game_state* %0, %struct.game_state** %3
%4 = call i32 (...) @getch()
switch i32 %4, label %9 [
i32 114, label %5
i32 113, label %8
]
5: ; preds = %1
%6 = load %struct.game_state*, %struct.game_state** %3
%7 = call i32 @randomize(%struct.game_state* %6)
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %14
9: ; preds = %1, %5
%10 = load %struct.game_state*, %struct.game_state** %3
%11 = call i32 @iterate(%struct.game_state* %10)
%12 = load %struct.game_state*, %struct.game_state** %3
%13 = call i32 @draw(%struct.game_state* %12)
store i32 1, i32* %2
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
%struct.game_state = type { i32 }
define i32 @game_step(%struct.game_state* %0) {
%2 = tail call i32 (...) @getch()
switch i32 %2, label %5 [
i32 114, label %3
i32 113, label %8
]
3: ; preds = %1
%4 = tail call i32 @randomize(%struct.game_state* %0)
br label %5
5: ; preds = %1, %3
%6 = tail call i32 @iterate(%struct.game_state* %0)
%7 = tail call i32 @draw(%struct.game_state* %0)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ 1, %5 ], [ 0, %1 ]
ret i32 %9
}
void foo025(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo025(i32 %0) {
ret void
}
__attribute__((no)) unsigned int andc_pv(unsigned int *a, unsigned int b) {
  return ~b & *a;
}


x86 assembly (clang, -O0):
<andc_pv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
xor    $0xffffffff,%eax
mov    -0x8(%rbp),%rcx
and    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<andc_pv>:
mov    %esi,%eax
not    %eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @andc_pv(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = xor i32 %5, -1
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
%9 = and i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @andc_pv(i32* nocapture %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = load i32, i32* %0
%5 = and i32 %4, %3
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ myexit();
int /*<<< orphan*/ perror(char *);
void std_err(void) {
  perror("\nError");
  myexit();
}


x86 assembly (clang, -O0):
<std_err>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <perror@plt>
mov    $0x0,%al
call   1030 <myexit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<std_err>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <perror@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <myexit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\0AError\00"
define void @std_err() {
%1 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @myexit()
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\0AError\00"
define void @std_err() {
%1 = tail call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @myexit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_if_indextoname();
int /*<<< orphan*/ test_if_nameindex();
int /*<<< orphan*/ test_if_nametoindex();
int main(void) {
  test_if_nameindex();
  test_if_indextoname();
  test_if_nametoindex();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_if_nameindex()
%2 = tail call i32 (...) @test_if_indextoname()
%3 = tail call i32 (...) @test_if_nametoindex()
ret i32 0
}