xunge/DecIR huggingface dataset:
void check_preempt_curr_stop(struct rq *rq, struct task_struct *p, int flags) {}


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

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

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

LLVM IR (-O2):
%struct.rq = type opaque
%struct.task_struct = type opaque
define void @check_preempt_curr_stop(%struct.rq* nocapture %0, %struct.task_struct* nocapture %1, i32 %2) {
ret void
}
int mus_audio_close(int line) { return (-1); }


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

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

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

LLVM IR (-O2):
define i32 @mus_audio_close(i32 %0) {
ret i32 -1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int lcd_send_cmd(int);
int lcd_set_pos(uint8_t x, uint8_t y) {
  int ret;
  uint8_t cmd = ((y & 0x01) << 4) | (x & 0x0f);
  ret = lcd_send_cmd(0x03);
  if (ret)
    return ret;
  return lcd_send_cmd(cmd);
}


x86 assembly (clang, -O0):
<lcd_set_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1,%eax
shl    $0x4,%eax
mov    -0x8(%rbp),%ecx
and    $0xf,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    $0x3,%edi
call   1030 <lcd_send_cmd@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
je     1154 <lcd_set_pos+0x44>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115f <lcd_set_pos+0x4f>
mov    -0x14(%rbp),%edi
call   1030 <lcd_send_cmd@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_set_pos>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x3,%edi
call   1030 <lcd_send_cmd@plt>
test   %eax,%eax
je     112c <lcd_set_pos+0x1c>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
shl    $0x4,%ebx
and    $0x10,%ebx
and    $0xf,%ebp
or     %ebx,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <lcd_send_cmd@plt>

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

LLVM IR (-O2):
define i32 @lcd_set_pos(i32 %0, i32 %1) {
%3 = tail call i32 @lcd_send_cmd(i32 3)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = shl i32 %1, 4
%7 = and i32 %6, 16
%8 = and i32 %0, 15
%9 = or i32 %7, %8
%10 = tail call i32 @lcd_send_cmd(i32 %9)
br label %11
11: ; preds = %2, %5
%12 = phi i32 [ %10, %5 ], [ %3, %2 ]
ret i32 %12
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_barrier_t;

/* Variables and functions */
int pthread_barrier_destroy(pthread_barrier_t *barrier) {
  ;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @pthread_barrier_destroy(i32* nocapture readnone %0) {
ret i32 0
}
void g_unicode_canonical_ordering() {}


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

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

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

LLVM IR (-O2):
define void @g_unicode_canonical_ordering() {
ret void
}
int test_imm_5Eint64_lowword_mem(long long *val) {
  return ((*val) & (0x5E << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_5Eint64_lowword_mem>:
testb  $0x5e,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Eint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 94
%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_5Eint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 94
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
testjump(label, ft) int label;
int ft;
{
  ol("cmpd\t#0");
  if (ft)
    ot("lbne\t");
  else
    ot("lbeq\t");
  printlabel(label);
  nl();
}


x86 assembly (clang, -O0):
<testjump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1050 <ol@plt>
cmpl   $0x0,-0xc(%rbp)
je     1179 <testjump+0x39>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <ot@plt>
jmp    1187 <testjump+0x47>
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <ot@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1060 <printlabel@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testjump>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1050 <ol@plt>
test   %ebx,%ebx
lea    0xeb0(%rip),%rax
lea    0xea3(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1040 <ot@plt>
mov    %ebp,%edi
xor    %eax,%eax
call   1060 <printlabel@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"cmpd\09\00"
@.str.1 = [6 x i8] c"lbne\09\00"
@.str.2 = [6 x i8] c"lbeq\09\00"
define i32 @testjump(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %5
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = load i32, i32* %4
%15 = call i32 (i32, ...) bitcast (i32 (...)* @printlabel to i32 (i32, ...)*)(i32 %14)
%16 = call i32 (...) @nl()
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [8 x i8] c"cmpd\09\00"
@.str.1 = [6 x i8] c"lbne\09\00"
@.str.2 = [6 x i8] c"lbeq\09\00"
define i32 @testjump(i32 %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ol to i32 (i8*, ...)*)(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %1, 0
%5 = select i1 %4, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* %5)
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @printlabel to i32 (i32, ...)*)(i32 %0)
%8 = tail call i32 (...) @nl()
ret i32 undef
}
/* Variables and functions */
void __libc_free(void *);
void free(void *p) { return __libc_free(p); }


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

x86 assembly (clang, -O2):
<free>:
jmp    1030 <__libc_free@plt>

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

LLVM IR (-O2):
define void @free(i8* %0) {
tail call void @__libc_free(i8* %0)
ret void
}
int _fstat(int fd) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_fstat(i32 %0) {
ret i32 -1
}
int hwnat_qos_queue_setup(void) {}


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

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

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

LLVM IR (-O2):
define i32 @hwnat_qos_queue_setup() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ PositionActualHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void PositionActualUpdated() { UAVObjUpdated(PositionActualHandle()); }


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

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

LLVM IR (-O0):
define void @PositionActualUpdated() {
%1 = call i32 (...) @PositionActualHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PositionActualUpdated() {
%1 = tail call i32 (...) @PositionActualHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ some_function();
int main() {
  some_function();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @some_function()
ret i32 0
}
double __ddiv_ru(double x, double y) { return x / y; }


x86 assembly (clang, -O0):
<__ddiv_ru>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ddiv_ru>:
divsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @__ddiv_ru(double %0, double %1) {
%3 = fdiv double %0, %1
ret double %3
}
unsigned long __arch_copy_to_user(void *x, void *y, unsigned long z) {
  unsigned long a;
  return a;
}


x86 assembly (clang, -O0):
<__arch_copy_to_user>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @__arch_copy_to_user(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @__arch_copy_to_user(i8* nocapture readnone %0, i8* nocapture readnone %1, i64 %2) {
ret i64 undef
}
unsigned short get_le16(unsigned short v_) {
  const unsigned char *v = (const unsigned char *)&v_;
  unsigned short r = v[1];
  r <<= 8;
  r |= v[0];
  return r;
}


x86 assembly (clang, -O0):
<get_le16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
lea    -0x2(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
shl    $0x8,%eax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%ecx
movzwl -0x12(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_le16>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @get_le16(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8*
%4 = alloca i16
store i16 %0, i16* %2
%5 = bitcast i16* %2 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i16
store i16 %9, i16* %4
%10 = load i16, i16* %4
%11 = zext i16 %10 to i32
%12 = shl i32 %11, 8
%13 = trunc i32 %12 to i16
store i16 %13, i16* %4
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i16, i16* %4
%19 = zext i16 %18 to i32
%20 = or i32 %19, %17
%21 = trunc i32 %20 to i16
store i16 %21, i16* %4
%22 = load i16, i16* %4
ret i16 %22
}

LLVM IR (-O2):
define zeroext i16 @get_le16(i16 returned zeroext %0) {
ret i16 %0
}
/* Type definitions */
struct feed_text {
  int dummy;
};
struct feed_client {
  int dummy;
};

/* Variables and functions */
char feed_text_init(struct feed_text *const, struct feed_client *const);
char feed_text_init_cb(void *const p_object, struct feed_client *const p_client,
                       void const *const p_descriptor) {
  char b_result;
  struct feed_text *const p_text = (struct feed_text *)(p_object);
  (void)(p_descriptor);
  b_result = feed_text_init(p_text, p_client);
  return b_result;
}


x86 assembly (clang, -O0):
<feed_text_init_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <feed_text_init@plt>
mov    %al,-0x19(%rbp)
movsbl -0x19(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<feed_text_init_cb>:
jmp    1030 <feed_text_init@plt>

LLVM IR (-O0):
%struct.feed_client = type { i32 }
%struct.feed_text = type { i32 }
define signext i8 @feed_text_init_cb(i8* %0, %struct.feed_client* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca %struct.feed_client*
%6 = alloca i8*
%7 = alloca i8
%8 = alloca %struct.feed_text*
store i8* %0, i8** %4
store %struct.feed_client* %1, %struct.feed_client** %5
store i8* %2, i8** %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to %struct.feed_text*
store %struct.feed_text* %10, %struct.feed_text** %8
%11 = load i8*, i8** %6
%12 = load %struct.feed_text*, %struct.feed_text** %8
%13 = load %struct.feed_client*, %struct.feed_client** %5
%14 = call signext i8 @feed_text_init(%struct.feed_text* %12, %struct.feed_client* %13)
store i8 %14, i8* %7
%15 = load i8, i8* %7
ret i8 %15
}

LLVM IR (-O2):
%struct.feed_client = type { i32 }
%struct.feed_text = type { i32 }
define signext i8 @feed_text_init_cb(i8* %0, %struct.feed_client* %1, i8* nocapture readnone %2) {
%4 = bitcast i8* %0 to %struct.feed_text*
%5 = tail call signext i8 @feed_text_init(%struct.feed_text* %4, %struct.feed_client* %1)
ret i8 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ namcoGuessN175(int /*<<< orphan*/);
int /*<<< orphan*/ namco_setParamsC0XX_N175(int /*<<< orphan*/,
                                            int /*<<< orphan*/);
void namco_setParamsC0XX_GuessN175(uint16_t addr, uint8_t val) {
  namcoGuessN175(addr);
  namco_setParamsC0XX_N175(addr, val);
}


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

x86 assembly (clang, -O2):
<namco_setParamsC0XX_GuessN175>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <namcoGuessN175@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <namco_setParamsC0XX_N175@plt>

LLVM IR (-O0):
define void @namco_setParamsC0XX_GuessN175(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 = call i32 @namcoGuessN175(i32 %5)
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 @namco_setParamsC0XX_N175(i32 %7, i32 %8)
ret void
}

LLVM IR (-O2):
define void @namco_setParamsC0XX_GuessN175(i32 %0, i32 %1) {
%3 = tail call i32 @namcoGuessN175(i32 %0)
%4 = tail call i32 @namco_setParamsC0XX_N175(i32 %0, i32 %1)
ret void
}
int func2(int x) {
  static char buffer[100];
  return 4;
}


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

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

LLVM IR (-O0):
@func2.buffer = internal global [100 x i8] zeroinitializer
define i32 @func2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i32 4
}

LLVM IR (-O2):
define i32 @func2(i32 %0) {
ret i32 4
}
int test_imm_5Fuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x5F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_5Fuint64_lowword_mem>:
testb  $0x5f,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_5Fuint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 95
%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_5Fuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 95
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ irq_init();
int /*<<< orphan*/ mutex_init();
void ken_init() {
  mutex_init();
  irq_init();
}


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

x86 assembly (clang, -O2):
<ken_init>:
push   %rax
xor    %eax,%eax
call   1030 <mutex_init@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <irq_init@plt>

LLVM IR (-O0):
define void @ken_init() {
%1 = call i32 (...) @mutex_init()
%2 = call i32 (...) @irq_init()
ret void
}

LLVM IR (-O2):
define void @ken_init() {
%1 = tail call i32 (...) @mutex_init()
%2 = tail call i32 (...) @irq_init()
ret void
}
/* Variables and functions */
int rand();
int rollDie(int min, int max) { return rand() % (max + 1 - min) + min; }


x86 assembly (clang, -O0):
<rollDie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x8(%rbp),%ecx
add    $0x1,%ecx
sub    -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rollDie>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rollDie(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @rand()
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = load i32, i32* %3
%9 = sub nsw i32 %7, %8
%10 = srem i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rollDie(i32 %0, i32 %1) {
%3 = tail call i32 (...) @rand()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = srem i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
void base_termios_exit(void) {}


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

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

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

LLVM IR (-O2):
define void @base_termios_exit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ defmac(char *);
void initmac(void) {
  defmac("mc6809\t1");
  defmac("smallc\t1");
}


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

x86 assembly (clang, -O2):
<initmac>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <defmac@plt>
lea    0xee5(%rip),%rdi
pop    %rax
jmp    1030 <defmac@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"mc6809\091\00"
@.str.1 = [9 x i8] c"smallc\091\00"
define void @initmac() {
%1 = call i32 @defmac(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @defmac(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"mc6809\091\00"
@.str.1 = [9 x i8] c"smallc\091\00"
define void @initmac() {
%1 = tail call i32 @defmac(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @defmac(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ usage();
void help(void) {
  usage();
  printf(
      "\nA program for converting XPM's into Microchip PIC include files\n\n");
  exit(0);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <usage@plt>
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
xor    %eax,%eax
call   1040 <usage@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [67 x i8] c"\0AA program for converting XPM's into Microchip PIC include files\0A\0A\00"
define void @help() {
%1 = call i32 (...) @usage()
%2 = call i32 @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [66 x i8] c"\0AA program for converting XPM's into Microchip PIC include files\0A\00"
define void @help() {
%1 = tail call i32 (...) @usage()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
int test_imm_0Fuint16_mem(unsigned short *val) {
  return ((*val) & (0x0F << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_0Fuint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0xf,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_0Fuint16_mem>:
testb  $0xf,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_0Fuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 15
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ myWrite(int, int *, int);
void sendStart(int fd) {
  uint8_t data[1] = {128};
  myWrite(fd, data, 1);
}


x86 assembly (clang, -O0):
<sendStart>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0xedf(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x8(%rbp),%rsi
mov    $0x1,%edx
call   1030 <myWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sendStart>:
push   %rax
movl   $0x80,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x1,%edx
call   1030 <myWrite@plt>
pop    %rax
ret

LLVM IR (-O0):
@__const.sendStart.data = [1 x i32] [i32 128]
define void @sendStart(i32 %0) {
%2 = alloca i32
%3 = alloca [1 x i32]
store i32 %0, i32* %2
%4 = bitcast [1 x i32]* %3 to i8*
%5 = load i32, i32* %2
%6 = getelementptr inbounds [1 x i32], [1 x i32]* %3, i64 0, i64 0
%7 = call i32 @myWrite(i32 %5, i32* %6, i32 1)
ret void
}

LLVM IR (-O2):
define void @sendStart(i32 %0) {
%2 = alloca [1 x i32]
%3 = bitcast [1 x i32]* %2 to i8*
%4 = getelementptr inbounds [1 x i32], [1 x i32]* %2, i64 0, i64 0
store i32 128, i32* %4
%5 = call i32 @myWrite(i32 %0, i32* %4, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bar(char *);
int /*<<< orphan*/ bar2(int *);
void foo() {
  {
    char a[100];
    bar(a);
  }
  {
    int a[100];
    bar2(a);
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
lea    -0x70(%rbp),%rdi
call   1040 <bar@plt>
lea    -0x200(%rbp),%rdi
call   1030 <bar2@plt>
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x198,%rsp
mov    %rsp,%rdi
call   1040 <bar@plt>
mov    %rsp,%rdi
call   1030 <bar2@plt>
add    $0x198,%rsp
ret

LLVM IR (-O0):
define void @foo() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i32]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @bar(i8* %3)
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%6 = call i32 @bar2(i32* %5)
ret void
}

LLVM IR (-O2):
define void @foo() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i32]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = call i32 @bar(i8* %3)
%5 = bitcast [100 x i32]* %2 to i8*
%6 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%7 = call i32 @bar2(i32* %6)
ret void
}
/* Variables and functions */
scalar_t__ isspace(char);
char *move_back_skip_space(char *p) {
  char *p1;
  p1 = p;
  while (isspace(*p1))
    p1--;
  p1++;
  return p1;
}


x86 assembly (clang, -O0):
<move_back_skip_space>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     114b <move_back_skip_space+0x3b>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <move_back_skip_space+0x14>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<move_back_skip_space>:
push   %rbx
mov    %rdi,%rbx
add    $0x2,%rbx
nopl   0x0(%rax,%rax,1)
movsbl -0x2(%rbx),%edi
call   1030 <isspace@plt>
add    $0xffffffffffffffff,%rbx
test   %rax,%rax
jne    1120 <move_back_skip_space+0x10>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @move_back_skip_space(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %10, %1
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = call i64 @isspace(i8 signext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %5
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8, i8* %11, i32 -1
store i8* %12, i8** %3
br label %5
13: ; preds = %5
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i32 1
store i8* %15, i8** %3
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
define i8* @move_back_skip_space(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %7, %2 ]
%4 = load i8, i8* %3
%5 = tail call i64 @isspace(i8 signext %4)
%6 = icmp eq i64 %5, 0
%7 = getelementptr inbounds i8, i8* %3, i64 -1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = getelementptr inbounds i8, i8* %3, i64 1
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
void main(void) {
  float peso;
  printf("Insira o peso: ");
  scanf("%f", &peso);
  peso *= 1000;
  printf("Seu peso em gramas eh: %.2f", peso);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  0xeb2(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeaf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
mulss  0xeb2(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xeb8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Insira o peso: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"Seu peso em gramas eh: %.2f\00"
define void @main() {
%1 = alloca float
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fmul float %4, 1.000000e+03
store float %5, float* %1
%6 = load float, float* %1
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %7)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"Insira o peso: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [28 x i8] c"Seu peso em gramas eh: %.2f\00"
define void @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%5 = load float, float* %1
%6 = fmul float %5, 1.000000e+03
store float %6, float* %1
%7 = fpext float %6 to double
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %7)
ret void
}
/* Variables and functions */
int CHAR_BIT;
int pack_char(char cha, char chb, char chc, char chd) {
  int integer_val = cha;
  integer_val = (integer_val << CHAR_BIT) | chb;
  integer_val = (integer_val << CHAR_BIT) | chc;
  integer_val = (integer_val << CHAR_BIT) | chd;
  return integer_val;
}


x86 assembly (clang, -O0):
<pack_char>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2eb4(%rip),%rcx
mov    (%rcx),%ecx
shl    %cl,%eax
movsbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e9d(%rip),%rcx
mov    (%rcx),%ecx
shl    %cl,%eax
movsbl -0x3(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    0x2e86(%rip),%rcx
mov    (%rcx),%ecx
shl    %cl,%eax
movsbl -0x4(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pack_char>:
mov    %ecx,%eax
mov    0x2ed7(%rip),%rcx
mov    (%rcx),%cl
shl    %cl,%edi
or     %esi,%edi
shl    %cl,%edi
or     %edx,%edi
shl    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @pack_char(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i32
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%10 = load i8, i8* %5
%11 = sext i8 %10 to i32
store i32 %11, i32* %9
%12 = load i32, i32* %9
%13 = load i32, i32* @CHAR_BIT
%14 = shl i32 %12, %13
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
%17 = or i32 %14, %16
store i32 %17, i32* %9
%18 = load i32, i32* %9
%19 = load i32, i32* @CHAR_BIT
%20 = shl i32 %18, %19
%21 = load i8, i8* %7
%22 = sext i8 %21 to i32
%23 = or i32 %20, %22
store i32 %23, i32* %9
%24 = load i32, i32* %9
%25 = load i32, i32* @CHAR_BIT
%26 = shl i32 %24, %25
%27 = load i8, i8* %8
%28 = sext i8 %27 to i32
%29 = or i32 %26, %28
store i32 %29, i32* %9
%30 = load i32, i32* %9
ret i32 %30
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @pack_char(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
%5 = sext i8 %0 to i32
%6 = load i32, i32* @CHAR_BIT
%7 = shl i32 %5, %6
%8 = sext i8 %1 to i32
%9 = or i32 %7, %8
%10 = shl i32 %9, %6
%11 = sext i8 %2 to i32
%12 = or i32 %10, %11
%13 = shl i32 %12, %6
%14 = sext i8 %3 to i32
%15 = or i32 %13, %14
ret i32 %15
}
void stw(unsigned int *p, unsigned int x) { p[15] = x; }


x86 assembly (clang, -O0):
<stw>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x3c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<stw>:
mov    %esi,0x3c(%rdi)
ret

LLVM IR (-O0):
define void @stw(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 = load i32*, i32** %3
%7 = getelementptr inbounds i32, i32* %6, i64 15
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @stw(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 15
store i32 %1, i32* %3
ret void
}
void phmmUnpackMommy(unsigned char mommy, int *retStateIx, int *retQoff,
                     int *retToff) {
  *retStateIx = (mommy & 31);
  *retQoff = -((mommy & 32) >> 5);
  *retToff = -((mommy & 64) >> 6);
}


x86 assembly (clang, -O0):
<phmmUnpackMommy>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0x1f,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movzbl -0x1(%rbp),%eax
and    $0x20,%eax
sar    $0x5,%eax
xor    %ecx,%ecx
sub    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movzbl -0x1(%rbp),%eax
and    $0x40,%eax
sar    $0x6,%eax
xor    %ecx,%ecx
sub    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<phmmUnpackMommy>:
mov    %edi,%eax
and    $0x1f,%eax
mov    %eax,(%rsi)
mov    %edi,%eax
shr    $0x5,%eax
and    $0x1,%eax
neg    %eax
mov    %eax,(%rdx)
shr    $0x6,%edi
and    $0x1,%edi
neg    %edi
mov    %edi,(%rcx)
ret

LLVM IR (-O0):
define void @phmmUnpackMommy(i8 zeroext %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i8
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i8 %0, i8* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = and i32 %10, 31
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i8, i8* %5
%14 = zext i8 %13 to i32
%15 = and i32 %14, 32
%16 = ashr i32 %15, 5
%17 = sub nsw i32 0, %16
%18 = load i32*, i32** %7
store i32 %17, i32* %18
%19 = load i8, i8* %5
%20 = zext i8 %19 to i32
%21 = and i32 %20, 64
%22 = ashr i32 %21, 6
%23 = sub nsw i32 0, %22
%24 = load i32*, i32** %8
store i32 %23, i32* %24
ret void
}

LLVM IR (-O2):
define void @phmmUnpackMommy(i8 zeroext %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = zext i8 %0 to i32
%6 = and i32 %5, 31
store i32 %6, i32* %1
%7 = lshr i32 %5, 5
%8 = and i32 %7, 1
%9 = sub nsw i32 0, %8
store i32 %9, i32* %2
%10 = lshr i32 %5, 6
%11 = and i32 %10, 1
%12 = sub nsw i32 0, %11
store i32 %12, i32* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int hash(int /*<<< orphan*/ *, size_t, int /*<<< orphan*/ const *, size_t, int,
         int);
int keccak_512(uint8_t *out, size_t outlen, const uint8_t *in, size_t inlen) {
  if (outlen > (512 / 8)) {
    return -1;
  }
  return hash(out, outlen, in, inlen, 200 - (512 / 4), 0x01);
}


x86 assembly (clang, -O0):
<keccak_512>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x40,-0x18(%rbp)
jbe    113f <keccak_512+0x2f>
movl   $0xffffffff,-0x4(%rbp)
jmp    1163 <keccak_512+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x48,%r8d
mov    $0x1,%r9d
call   1030 <hash@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keccak_512>:
cmp    $0x40,%rsi
jbe    111c <keccak_512+0xc>
mov    $0xffffffff,%eax
ret
mov    $0x48,%r8d
mov    $0x1,%r9d
jmp    1030 <hash@plt>

LLVM IR (-O0):
define i32 @keccak_512(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i64
store i32* %0, i32** %6
store i64 %1, i64* %7
store i32* %2, i32** %8
store i64 %3, i64* %9
%10 = load i64, i64* %7
%11 = icmp ugt i64 %10, 64
br i1 %11, label %12, label %13
12: ; preds = %4
store i32 -1, i32* %5
br label %19
13: ; preds = %4
%14 = load i32*, i32** %6
%15 = load i64, i64* %7
%16 = load i32*, i32** %8
%17 = load i64, i64* %9
%18 = call i32 @hash(i32* %14, i64 %15, i32* %16, i64 %17, i32 72, i32 1)
store i32 %18, i32* %5
br label %19
19: ; preds = %13, %12
%20 = load i32, i32* %5
ret i32 %20
}

LLVM IR (-O2):
define i32 @keccak_512(i32* %0, i64 %1, i32* %2, i64 %3) {
%5 = icmp ugt i64 %1, 64
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @hash(i32* %0, i64 %1, i32* %2, i64 %3, i32 72, i32 1)
br label %8
8: ; preds = %4, %6
%9 = phi i32 [ %7, %6 ], [ -1, %4 ]
ret i32 %9
}
void fc143(int n) {
  {
    typedef int(*b)[n];
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    };
    typedef int(*e)[n];
    0;
  };
a : {
  typedef int(*f)[n];
  goto a;
  {
    typedef int(*g)[n];
    0;
  };
  {
    typedef int(*h)[n];
    0;
  };
  ;
  typedef int(*i)[n];
  0;
};
  ;
  typedef int(*j)[n];
  0;
}


x86 assembly (clang, -O0):
<fc143>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fc143+0x7>

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

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

LLVM IR (-O2):
define void @fc143(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
double d2mce_time() {
  double gettime;
  struct timeval now;
  gettimeofday(&now, 0);
  gettime = 1000000 * now.tv_sec + now.tv_usec;
  gettime /= 1000000;
  return gettime;
}


x86 assembly (clang, -O0):
<d2mce_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xebd(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d2mce_time>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
cvtsi2sd %eax,%xmm0
divsd  0xece(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define double @d2mce_time() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 1000000, %5
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sitofp i32 %9 to double
store double %10, double* %1
%11 = load double, double* %1
%12 = fdiv double %11, 1.000000e+06
store double %12, double* %1
%13 = load double, double* %1
ret double %13
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define double @d2mce_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 1.000000e+06
ret double %11
}
void RTEnvPutEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTEnvPutEx() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int pthread_attr_destroy(int /*<<< orphan*/ *);
void attr_destroy(pthread_attr_t *attr) {
  int err = pthread_attr_destroy(attr);
  if (err != 0) {
    perror("pthread_attr_destroy");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<attr_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_attr_destroy@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     116c <attr_destroy+0x3c>
lea    0xea7(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<attr_destroy>:
push   %rax
call   1040 <pthread_attr_destroy@plt>
test   %eax,%eax
jne    113c <attr_destroy+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"pthread_attr_destroy\00"
@EXIT_FAILURE = global i32 0
define void @attr_destroy(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_attr_destroy(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"pthread_attr_destroy\00"
@EXIT_FAILURE = global i32 0
define void @attr_destroy(i32* %0) {
%2 = tail call i32 @pthread_attr_destroy(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
void USART0_IRQHandler(void) {
  while (1)
    ;
}


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

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

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

LLVM IR (-O2):
define void @USART0_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
char *FilterCreate(void *arg, const char *const *key_array,
                   const size_t *key_length_array, int num_keys,
                   size_t *filter_length) {
  *filter_length = 4;
  char *result = malloc(4);
  memcpy(result, "fake", 4);
  return result;
}


x86 assembly (clang, -O0):
<FilterCreate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movq   $0x4,(%rax)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
lea    0xea1(%rip),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FilterCreate>:
push   %rbx
movq   $0x4,(%r8)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
lea    0xec4(%rip),%rsi
mov    %rax,%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"fake\00"
define i8* @FilterCreate(i8* nocapture readnone %0, i8** nocapture readnone %1, i64* nocapture readnone %2, i32 %3, i64* nocapture writeonly %4) {
store i64 4, i64* %4
%6 = tail call dereferenceable_or_null(4) i8* @malloc(i32 4)
%7 = tail call i32 @memcpy(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_memory(void *variable) { free(variable); }


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

x86 assembly (clang, -O2):
<free_memory>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @free_memory(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test1();
int /*<<< orphan*/ test2();
int main(void) {
  test1();
  test2();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test1@plt>
mov    $0x0,%al
call   1040 <test2@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test1()
%2 = call i32 (...) @test2()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test1()
%2 = tail call i32 (...) @test2()
ret i32 0
}