xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void print_nums(int n) {
  char it;
  if (n <= 0)
    return;
  it = '0';
  while (it <= '9' - n + 1) {
    print_nums(n - 1);
    ft_putchar(it);
    it++;
  }
  ft_putchar(' ');
}


x86 assembly (clang, -O0):
<print_nums>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     113a <print_nums+0x1a>
jmp    1180 <print_nums+0x60>
movb   $0x30,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
mov    $0x39,%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jg     1176 <print_nums+0x56>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1030 <print_nums@plt>
movsbl -0x5(%rbp),%edi
call   1040 <ft_putchar@plt>
mov    -0x5(%rbp),%al
add    $0x1,%al
mov    %al,-0x5(%rbp)
jmp    113e <print_nums+0x1e>
mov    $0x20,%edi
call   1040 <ft_putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_nums>:
test   %edi,%edi
jle    116d <print_nums+0x4d>
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
cmp    $0xa,%edi
jg     115f <print_nums+0x3f>
mov    $0x3a,%r14d
sub    %ebx,%r14d
add    $0xffffffff,%ebx
mov    $0x30,%bpl
xchg   %ax,%ax
mov    %ebx,%edi
call   1030 <print_nums@plt>
movsbl %bpl,%ebp
mov    %ebp,%edi
call   1040 <ft_putchar@plt>
add    $0x1,%bpl
movsbl %bpl,%eax
cmp    %eax,%r14d
jge    1140 <print_nums+0x20>
mov    $0x20,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <ft_putchar@plt>
ret

LLVM IR (-O0):
define void @print_nums(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %24
7: ; preds = %1
store i8 48, i8* %3
br label %8
8: ; preds = %15, %7
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = load i32, i32* %2
%12 = sub nsw i32 57, %11
%13 = add nsw i32 %12, 1
%14 = icmp sle i32 %10, %13
br i1 %14, label %15, label %22
15: ; preds = %8
%16 = load i32, i32* %2
%17 = sub nsw i32 %16, 1
%18 = load i8, i8* %3
%19 = call i32 @ft_putchar(i8 signext %18)
%20 = load i8, i8* %3
%21 = add i8 %20, 1
store i8 %21, i8* %3
br label %8
22: ; preds = %8
%23 = call i32 @ft_putchar(i8 signext 32)
br label %24
24: ; preds = %22, %6
ret void
}

LLVM IR (-O2):
define void @print_nums(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %16, label %3
3: ; preds = %1
%4 = sub nsw i32 58, %0
%5 = icmp sgt i32 %0, 10
br i1 %5, label %14, label %6
6: ; preds = %3
%7 = add nsw i32 %0, -1
br label %8
8: ; preds = %6, %8
%9 = phi i8 [ 48, %6 ], [ %11, %8 ]
tail call void @print_nums(i32 %7)
%10 = tail call i32 @ft_putchar(i8 signext %9)
%11 = add i8 %9, 1
%12 = sext i8 %11 to i32
%13 = icmp slt i32 %4, %12
br i1 %13, label %14, label %8
14: ; preds = %8, %3
%15 = tail call i32 @ft_putchar(i8 signext 32)
br label %16
16: ; preds = %1, %14
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hex_word(unsigned int);
void hex_dword(unsigned int word) {
  hex_word(word >> 16);
  hex_word(word & 0xFFFF);
}


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

x86 assembly (clang, -O2):
<hex_dword>:
push   %rbx
mov    %edi,%ebx
shr    $0x10,%edi
call   1030 <hex_word@plt>
movzwl %bx,%edi
pop    %rbx
jmp    1030 <hex_word@plt>

LLVM IR (-O0):
define void @hex_dword(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = call i32 @hex_word(i32 %4)
%6 = load i32, i32* %2
%7 = and i32 %6, 65535
%8 = call i32 @hex_word(i32 %7)
ret void
}

LLVM IR (-O2):
define void @hex_dword(i32 %0) {
%2 = lshr i32 %0, 16
%3 = tail call i32 @hex_word(i32 %2)
%4 = and i32 %0, 65535
%5 = tail call i32 @hex_word(i32 %4)
ret void
}
/* Variables and functions */
long INT_MAX;
long INT_MIN;
float scalbnf(float, long);
float scalblnf(float x, long n) {
  if (n > INT_MAX)
    n = INT_MAX;
  else if (n < INT_MIN)
    n = INT_MIN;
  return scalbnf(x, n);
}


x86 assembly (clang, -O0):
<scalblnf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ebc(%rip),%rcx
cmp    (%rcx),%rax
jle    1148 <scalblnf+0x38>
mov    0x2eac(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    116f <scalblnf+0x5f>
mov    -0x10(%rbp),%rax
mov    0x2e8d(%rip),%rcx
cmp    (%rcx),%rax
jge    116a <scalblnf+0x5a>
mov    0x2e7d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
jmp    116f <scalblnf+0x5f>
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <scalbnf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalblnf>:
mov    0x2ed1(%rip),%rcx
mov    0x2ec2(%rip),%rax
mov    (%rax),%rax
cmp    %rdi,%rax
cmovle %rdi,%rax
mov    (%rcx),%rcx
cmp    %rdi,%rcx
cmovl  %rcx,%rax
mov    %rax,%rdi
jmp    1030 <scalbnf@plt>

LLVM IR (-O0):
@INT_MAX = global i64 0
@INT_MIN = global i64 0
define float @scalblnf(float %0, i64 %1) {
%3 = alloca float
%4 = alloca i64
store float %0, float* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* @INT_MAX
%7 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* @INT_MAX
store i64 %9, i64* %4
br label %17
10: ; preds = %2
%11 = load i64, i64* %4
%12 = load i64, i64* @INT_MIN
%13 = icmp slt i64 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = load i64, i64* @INT_MIN
store i64 %15, i64* %4
br label %16
16: ; preds = %14, %10
br label %17
17: ; preds = %16, %8
%18 = load float, float* %3
%19 = load i64, i64* %4
%20 = call float @scalbnf(float %18, i64 %19)
ret float %20
}

LLVM IR (-O2):
@INT_MAX = global i64 0
@INT_MIN = global i64 0
define float @scalblnf(float %0, i64 %1) {
%3 = load i64, i64* @INT_MAX
%4 = icmp slt i64 %3, %1
%5 = load i64, i64* @INT_MIN
%6 = icmp sgt i64 %5, %1
%7 = select i1 %6, i64 %5, i64 %1
%8 = select i1 %4, i64 %3, i64 %7
%9 = tail call float @scalbnf(float %0, i64 %8)
ret float %9
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *name) {
  printf("usage: %s [-m] policy_file context_file\n", name);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"usage: %s [-m] policy_file context_file\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [41 x i8] c"usage: %s [-m] policy_file context_file\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int /*<<< orphan*/ vt100TextColor(int, int /*<<< orphan*/);
int /*<<< orphan*/ vt100TextDefault();
void PrintAnomalyMessage(const char *msg) {
  vt100TextColor(6, 0);
  printf("%s\r\n", msg);
  vt100TextDefault();
}


x86 assembly (clang, -O0):
<PrintAnomalyMessage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <vt100TextColor@plt>
mov    -0x8(%rbp),%rsi
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <vt100TextDefault@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintAnomalyMessage>:
push   %rbx
mov    %rdi,%rbx
mov    $0x6,%edi
xor    %esi,%esi
call   1030 <vt100TextColor@plt>
lea    0xeb9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
jmp    1050 <vt100TextDefault@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s\0D\0A\00"
define void @PrintAnomalyMessage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @vt100TextColor(i32 6, i32 0)
%4 = load i8*, i8** %2
%5 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @vt100TextDefault()
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s\0D\0A\00"
define void @PrintAnomalyMessage(i8* %0) {
%2 = tail call i32 @vt100TextColor(i32 6, i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (...) @vt100TextDefault()
ret void
}
void ff_hevc_put_hevc_uni_w_pel_pixels6_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_pel_pixels6_10_sse4() {
ret void
}
void glEGLImageTargetRenderbufferStorageOES(void) { return; }


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

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

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

LLVM IR (-O2):
define void @glEGLImageTargetRenderbufferStorageOES() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPIODirModeSet(unsigned long, unsigned char, int);
int /*<<< orphan*/ GPIOPadConfigSet(unsigned long, unsigned char, int, int);
void GPIOPinTypeGPIOOutput(unsigned long ulPort, unsigned char ucPins) {
  ;
  GPIOPadConfigSet(ulPort, ucPins, 0x00000001, 0x00000008);
  GPIODirModeSet(ulPort, ucPins, 0x00000001);
}


x86 assembly (clang, -O0):
<GPIOPinTypeGPIOOutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    $0x8,%ecx
movzbl -0x9(%rbp),%esi
call   1030 <GPIOPadConfigSet@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
movzbl -0x9(%rbp),%esi
call   1040 <GPIODirModeSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GPIOPinTypeGPIOOutput>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x1,%edx
mov    $0x8,%ecx
call   1030 <GPIOPadConfigSet@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <GPIODirModeSet@plt>

LLVM IR (-O0):
define void @GPIOPinTypeGPIOOutput(i64 %0, i8 zeroext %1) {
%3 = alloca i64
%4 = alloca i8
store i64 %0, i64* %3
store i8 %1, i8* %4
%5 = load i64, i64* %3
%6 = load i8, i8* %4
%7 = call i32 @GPIOPadConfigSet(i64 %5, i8 zeroext %6, i32 1, i32 8)
%8 = load i64, i64* %3
%9 = load i8, i8* %4
%10 = call i32 @GPIODirModeSet(i64 %8, i8 zeroext %9, i32 1)
ret void
}

LLVM IR (-O2):
define void @GPIOPinTypeGPIOOutput(i64 %0, i8 zeroext %1) {
%3 = tail call i32 @GPIOPadConfigSet(i64 %0, i8 zeroext %1, i32 1, i32 8)
%4 = tail call i32 @GPIODirModeSet(i64 %0, i8 zeroext %1, i32 1)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
scalar_t__ pthread_mutex_destroy(int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
void xmutex_destroy(pthread_mutex_t *m) {
  if (pthread_mutex_destroy(m)) {
    fputs("xmutex_destroy\n", stderr);
    abort();
  }
}


x86 assembly (clang, -O0):
<xmutex_destroy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_mutex_destroy@plt>
cmp    $0x0,%rax
je     116b <xmutex_destroy+0x3b>
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
lea    0xea1(%rip),%rdi
call   1050 <fputs@plt>
mov    $0x0,%al
call   1030 <abort@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmutex_destroy>:
push   %rax
call   1040 <pthread_mutex_destroy@plt>
test   %rax,%rax
jne    113d <xmutex_destroy+0xd>
pop    %rax
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
lea    0xeb3(%rip),%rdi
call   1050 <fputs@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"xmutex_destroy\0A\00"
@stderr = global i32 0
define void @xmutex_destroy(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i64 @pthread_mutex_destroy(i32* %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"xmutex_destroy\0A\00"
@stderr = global i32 0
define void @xmutex_destroy(i32* %0) {
%2 = tail call i64 @pthread_mutex_destroy(i32* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fputs(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = tail call i32 (...) @abort()
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ m68ki_push_16(unsigned int);
int /*<<< orphan*/ m68ki_push_32(unsigned int);
void m68ki_stack_frame_3word(unsigned int pc, unsigned int sr) {
  m68ki_push_32(pc);
  m68ki_push_16(sr);
}


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

x86 assembly (clang, -O2):
<m68ki_stack_frame_3word>:
push   %rbx
mov    %esi,%ebx
call   1030 <m68ki_push_32@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <m68ki_push_16@plt>

LLVM IR (-O0):
define void @m68ki_stack_frame_3word(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 @m68ki_push_32(i32 %5)
%7 = load i32, i32* %4
%8 = call i32 @m68ki_push_16(i32 %7)
ret void
}

LLVM IR (-O2):
define void @m68ki_stack_frame_3word(i32 %0, i32 %1) {
%3 = tail call i32 @m68ki_push_32(i32 %0)
%4 = tail call i32 @m68ki_push_16(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  int a;
  a = (1, 45, 012);
  printf("%d\n", a);
  a = (1, 2, 03);
  printf("%d\n", a);
  a = (1, 2, 30);
  printf("%d\n", a);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x1e,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 30)
ret i32 0
}
char h(long l) { return l + 1; }


x86 assembly (clang, -O0):
<h>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<h>:
lea    0x1(%rdi),%eax
ret

LLVM IR (-O0):
define signext i8 @h(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 1
%5 = trunc i64 %4 to i8
ret i8 %5
}

LLVM IR (-O2):
define signext i8 @h(i64 %0) {
%2 = trunc i64 %0 to i8
%3 = add i8 %2, 1
ret i8 %3
}
/* Variables and functions */
int /*<<< orphan*/ emitln(char *);
char getName();
void other() {
  char outstring[2];
  outstring[0] = getName();
  outstring[1] = 0x00;
  emitln(outstring);
}


x86 assembly (clang, -O0):
<other>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getName@plt>
mov    %al,-0x2(%rbp)
movb   $0x0,-0x1(%rbp)
lea    -0x2(%rbp),%rdi
call   1030 <emitln@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<other>:
push   %rax
xor    %eax,%eax
call   1040 <getName@plt>
mov    %al,0x6(%rsp)
movb   $0x0,0x7(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <emitln@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @other() {
%1 = alloca [2 x i8]
%2 = call signext i8 (...) @getName()
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
store i8 %2, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 0, i8* %4
%5 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%6 = call i32 @emitln(i8* %5)
ret void
}

LLVM IR (-O2):
define void @other() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = tail call signext i8 (...) @getName()
store i8 %3, i8* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
store i8 0, i8* %4
%5 = call i32 @emitln(i8* %2)
ret void
}
int mem_cache_free(void *cache, void *addr) { return 0; }


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

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

LLVM IR (-O0):
define i32 @mem_cache_free(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret i32 0
}

LLVM IR (-O2):
define i32 @mem_cache_free(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
int atoi(char *);
scalar_t__ com_parse_char_command(char *, char *, char);
int com_parse_turn(char *command, int *turn) {
  char turn_string[256];
  if (com_parse_char_command(turn_string, command, 't')) {
    return 1;
  }
  *turn = atoi(turn_string);
  return 0;
}


x86 assembly (clang, -O0):
<com_parse_turn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x120(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x74,%edx
call   1040 <com_parse_char_command@plt>
cmp    $0x0,%rax
je     115e <com_parse_turn+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1179 <com_parse_turn+0x59>
lea    -0x120(%rbp),%rdi
call   1030 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<com_parse_turn>:
push   %rbx
sub    $0x100,%rsp
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%rdi
mov    $0x74,%edx
call   1040 <com_parse_char_command@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1154 <com_parse_turn+0x34>
mov    %rsp,%rdi
call   1030 <atoi@plt>
mov    %eax,(%rbx)
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @com_parse_turn(i8* %0, i32* nocapture writeonly %1) {
%3 = alloca [256 x i8]
%4 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%5 = call i64 @com_parse_char_command(i8* %4, i8* %0, i8 signext 116)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = call i32 @atoi(i8* %4)
store i32 %8, i32* %1
br label %9
9: ; preds = %2, %7
%10 = phi i32 [ 0, %7 ], [ 1, %2 ]
ret i32 %10
}
char *find_char(char c, char *s) {
  while (c != *s && *s)
    s++;
  return s;
}


x86 assembly (clang, -O0):
<find_char>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movsbl -0x1(%rbp),%ecx
mov    -0x10(%rbp),%rax
movsbl (%rax),%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0x11(%rbp)
je     1136 <find_char+0x36>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1146 <find_char+0x46>
jmp    1157 <find_char+0x57>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110e <find_char+0xe>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_char>:
mov    %rsi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
cmp    %dil,%cl
je     1121 <find_char+0x21>
test   %cl,%cl
jne    1110 <find_char+0x10>
ret

LLVM IR (-O0):
define i8* @find_char(i8 signext %0, i8* %1) {
%3 = alloca i8
%4 = alloca i8*
store i8 %0, i8* %3
store i8* %1, i8** %4
br label %5
5: ; preds = %19, %2
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %7, %10
br i1 %11, label %12, label %17
12: ; preds = %5
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br label %17
17: ; preds = %12, %5
%18 = phi i1 [ false, %5 ], [ %16, %12 ]
br i1 %18, label %19, label %22
19: ; preds = %17
%20 = load i8*, i8** %4
%21 = getelementptr inbounds i8, i8* %20, i32 1
store i8* %21, i8** %4
br label %5
22: ; preds = %17
%23 = load i8*, i8** %4
ret i8* %23
}

LLVM IR (-O2):
define i8* @find_char(i8 signext %0, i8* %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %9, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %0
%7 = icmp eq i8 %5, 0
%8 = or i1 %6, %7
%9 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %8, label %10, label %3
10: ; preds = %3
ret i8* %4
}
/* Variables and functions */
float sqrt(float);
float calculateDist(float x1, float y1, float x2, float y2) {
  float dist = 0;
  dist = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
  return dist;
}


x86 assembly (clang, -O0):
<calculateDist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
subss  -0x4(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm3
subss  -0x8(%rbp),%xmm3
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <sqrt@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculateDist>:
subss  %xmm0,%xmm2
subss  %xmm1,%xmm3
mulss  %xmm3,%xmm3
mulss  %xmm2,%xmm2
addss  %xmm3,%xmm2
xorps  %xmm0,%xmm0
ucomiss %xmm0,%xmm2
jb     1134 <calculateDist+0x24>
xorps  %xmm0,%xmm0
sqrtss %xmm2,%xmm0
ret
movaps %xmm2,%xmm0
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define float @calculateDist(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
store float 0.000000e+00, float* %9
%10 = load float, float* %7
%11 = load float, float* %5
%12 = fsub float %10, %11
%13 = load float, float* %7
%14 = load float, float* %5
%15 = fsub float %13, %14
%16 = load float, float* %8
%17 = load float, float* %6
%18 = fsub float %16, %17
%19 = load float, float* %8
%20 = load float, float* %6
%21 = fsub float %19, %20
%22 = fmul float %18, %21
%23 = call float @llvm.fmuladd.f32(float %12, float %15, float %22)
%24 = call float @sqrt(float %23)
store float %24, float* %9
%25 = load float, float* %9
ret float %25
}

LLVM IR (-O2):
define float @calculateDist(float %0, float %1, float %2, float %3) {
%5 = fsub float %2, %0
%6 = fsub float %3, %1
%7 = fmul float %6, %6
%8 = tail call float @llvm.fmuladd.f32(float %5, float %5, float %7)
%9 = tail call float @sqrt(float %8)
ret float %9
}
/* Variables and functions */
size_t id3_size2(const unsigned char *buffer) {
  size_t size = 0;
  size = (buffer[2] & 0x7f) + ((buffer[1] & 0x7f) << 7) +
         ((buffer[0] & 0x7f) << 14);
  return size;
}


x86 assembly (clang, -O0):
<id3_size2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
and    $0x7f,%eax
mov    -0x8(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
and    $0x7f,%ecx
shl    $0x7,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    $0x7f,%ecx
shl    $0xe,%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<id3_size2>:
movzbl 0x2(%rdi),%eax
and    $0x7f,%eax
movzbl 0x1(%rdi),%ecx
and    $0x7f,%ecx
shl    $0x7,%rcx
or     %rax,%rcx
movzbl (%rdi),%eax
and    $0x7f,%eax
shl    $0xe,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @id3_size2(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 2
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %7, 127
%9 = load i8*, i8** %2
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = and i32 %12, 127
%14 = shl i32 %13, 7
%15 = add nsw i32 %8, %14
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = and i32 %19, 127
%21 = shl i32 %20, 14
%22 = add nsw i32 %15, %21
%23 = sext i32 %22 to i64
store i64 %23, i64* %3
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
define i64 @id3_size2(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = and i8 %3, 127
%5 = zext i8 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = and i8 %7, 127
%9 = zext i8 %8 to i64
%10 = shl nuw nsw i64 %9, 7
%11 = or i64 %10, %5
%12 = load i8, i8* %0
%13 = and i8 %12, 127
%14 = zext i8 %13 to i64
%15 = shl nuw nsw i64 %14, 14
%16 = or i64 %11, %15
ret i64 %16
}
void append_face(char *p, int f) { *p++ = "UFRDBL"[f]; }


x86 assembly (clang, -O0):
<append_face>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
lea    0xeea(%rip),%rax
mov    (%rax,%rcx,1),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<append_face>:
movslq %esi,%rax
lea    0xef6(%rip),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,(%rdi)
ret

LLVM IR (-O0):
@.str = [7 x i8] c"UFRDBL\00"
define void @append_face(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [7 x i8], [7 x i8]* @.str, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i32 1
store i8* %10, i8** %3
store i8 %8, i8* %9
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"UFRDBL\00"
define void @append_face(i8* nocapture writeonly %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds [7 x i8], [7 x i8]* @.str, i64 0, i64 %3
%5 = load i8, i8* %4
store i8 %5, i8* %0
ret void
}
void gtk_text_buffer_set_modified() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_buffer_set_modified() {
ret void
}
unsigned int bcm2835_version(void) { return 10052; }


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

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

LLVM IR (-O0):
define i32 @bcm2835_version() {
ret i32 10052
}

LLVM IR (-O2):
define i32 @bcm2835_version() {
ret i32 10052
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printSpace() { printf(" "); }


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

x86 assembly (clang, -O2):
<printSpace>:
mov    $0x20,%edi
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
define void @printSpace() {
%1 = tail call i32 @putchar(i32 32)
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t __hsail_bitalign(uint64_t lower, uint64_t upper,
                          uint32_t shift_amount) {
  shift_amount = shift_amount & 31;
  uint64_t packed_value = (upper << 32) | lower;
  return (packed_value >> shift_amount) & 0xFFFFFFFF;
}


x86 assembly (clang, -O0):
<__hsail_bitalign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    %cl,%eax
and    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__hsail_bitalign(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = and i32 %8, 31
store i32 %9, i32* %6
%10 = load i32, i32* %5
%11 = shl i32 %10, 32
%12 = load i32, i32* %4
%13 = or i32 %11, %12
store i32 %13, i32* %7
%14 = load i32, i32* %7
%15 = load i32, i32* %6
%16 = ashr i32 %14, %15
%17 = and i32 %16, -1
ret i32 %17
}

LLVM IR (-O2):
define i32 @__hsail_bitalign(i32 %0, i32 %1, i32 %2) {
ret i32 poison
}
int gcd(int x, int y) {
  int g;
  g = y;
  while (x > 0) {
    g = x;
    x = y % x;
    y = g;
  }
  return g;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1135 <gcd+0x35>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %edx,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1110 <gcd+0x10>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %esi,%eax
test   %edi,%edi
jle    111d <gcd+0x1d>
mov    %edi,%edx
nopl   0x0(%rax,%rax,1)
mov    %edx,%ecx
cltd
idiv   %ecx
mov    %ecx,%eax
test   %edx,%edx
jg     1110 <gcd+0x10>
mov    %ecx,%eax
ret

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

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

/* Variables and functions */
uint8_t read_byte(uint8_t *buf, int offset) { return buf[offset]; }


x86 assembly (clang, -O0):
<read_byte>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_byte>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @read_byte(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @read_byte(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
/* Variables and functions */
char *str_format(char *, double);
char *str_from_double(double value) { return str_format("%f", value); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i8* @str_from_double(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i8* @str_format(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %3)
ret i8* %4
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i8* @str_from_double(double %0) {
%2 = tail call i8* @str_format(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), double %0)
ret i8* %2
}
/* Variables and functions */
unsigned long pio_indword(unsigned char);
void pio_rep_indword(unsigned char addrDataReg, unsigned char *bufAddr,
                     long dwordCnt) {
  while (dwordCnt > 0) {
    *(unsigned long *)bufAddr = pio_indword(addrDataReg);
    bufAddr += 4;
    dwordCnt--;
  }
}


x86 assembly (clang, -O0):
<pio_rep_indword>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jle    1161 <pio_rep_indword+0x51>
movzbl -0x1(%rbp),%edi
call   1030 <pio_indword@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    1126 <pio_rep_indword+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pio_rep_indword>:
push   %rbp
push   %r14
push   %rbx
test   %rdx,%rdx
jle    1148 <pio_rep_indword+0x38>
mov    %rdx,%r14
mov    %rsi,%rbx
add    $0x1,%r14
movzbl %dil,%ebp
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <pio_indword@plt>
mov    %rax,(%rbx)
add    $0x4,%rbx
add    $0xffffffffffffffff,%r14
cmp    $0x1,%r14
ja     1130 <pio_rep_indword+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @pio_rep_indword(i8 zeroext %0, i8* nocapture writeonly %1, i64 %2) {
%4 = icmp sgt i64 %2, 0
br i1 %4, label %5, label %13
5: ; preds = %3, %5
%6 = phi i64 [ %11, %5 ], [ %2, %3 ]
%7 = phi i8* [ %10, %5 ], [ %1, %3 ]
%8 = tail call i64 @pio_indword(i8 zeroext %0)
%9 = bitcast i8* %7 to i64*
store i64 %8, i64* %9
%10 = getelementptr inbounds i8, i8* %7, i64 4
%11 = add nsw i64 %6, -1
%12 = icmp ugt i64 %6, 1
br i1 %12, label %5, label %13
13: ; preds = %5, %3
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int c;
  int x, y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  c = 0;
  if (x > 0 && y > 0) {
    while (!(x == 0)) {
      if (x > y) {
        x = y;
      } else {
        x = x - 1;
      }
      c = c + 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    119c <main+0x8c>
cmpl   $0x0,-0x10(%rbp)
jle    119c <main+0x8c>
jmp    1153 <main+0x43>
cmpl   $0x0,-0xc(%rbp)
sete   %al
xor    $0xff,%al
test   $0x1,%al
jne    1169 <main+0x59>
jmp    1197 <main+0x87>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1180 <main+0x70>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1189 <main+0x79>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1153 <main+0x43>
jmp    119c <main+0x8c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %5, i32* %3
%6 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %6, i32* %4
store i32 0, i32* %2
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %30
9: ; preds = %0
%10 = load i32, i32* %4
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %30
12: ; preds = %9
br label %13
13: ; preds = %26, %12
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %29
17: ; preds = %13
%18 = load i32, i32* %3
%19 = load i32, i32* %4
%20 = icmp sgt i32 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load i32, i32* %4
store i32 %22, i32* %3
br label %26
23: ; preds = %17
%24 = load i32, i32* %3
%25 = sub nsw i32 %24, 1
store i32 %25, i32* %3
br label %26
26: ; preds = %23, %21
%27 = load i32, i32* %2
%28 = add nsw i32 %27, 1
store i32 %28, i32* %2
br label %13
29: ; preds = %13
br label %30
30: ; preds = %29, %9, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ VW_Bar(int, int, int, int, int);
scalar_t__ VW_MarkUpdateBlock(int, int, int, int);
void VWB_Bar(int x, int y, int width, int height, int color) {
  if (VW_MarkUpdateBlock(x, y, x + width, y + height - 1))
    VW_Bar(x, y, width, height, color);
}


x86 assembly (clang, -O0):
<VWB_Bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
add    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
add    -0x10(%rbp),%ecx
sub    $0x1,%ecx
call   1040 <VW_MarkUpdateBlock@plt>
cmp    $0x0,%rax
je     1171 <VWB_Bar+0x51>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <VW_Bar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VWB_Bar>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebx
mov    %edi,%ebp
lea    (%r12,%rbp,1),%edx
lea    (%rbx,%r15,1),%ecx
add    $0xffffffff,%ecx
call   1040 <VW_MarkUpdateBlock@plt>
test   %rax,%rax
je     1164 <VWB_Bar+0x44>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <VW_Bar@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @VWB_Bar(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = add nsw i32 %2, %0
%7 = add i32 %1, -1
%8 = add i32 %7, %3
%9 = tail call i64 @VW_MarkUpdateBlock(i32 %0, i32 %1, i32 %6, i32 %8)
%10 = icmp eq i64 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %5
%12 = tail call i32 @VW_Bar(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4)
br label %13
13: ; preds = %11, %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int write(int, char *, int);
int test1() {
  int a = 1;
  a = write(1, "Here is some data\n", 19);
  printf("write size=%d\n", a);
  a = write(2, "A write error has occurred on file description 1\n", 46);
  printf("error size=%d\n", a);
  return 0;
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x1,-0x4(%rbp)
mov    $0x1,%edi
lea    0xec5(%rip),%rsi
mov    $0x13,%edx
call   1030 <write@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
lea    0xebf(%rip),%rsi
mov    $0x2e,%edx
call   1030 <write@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xeda(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x1,%edi
mov    $0x13,%edx
call   1030 <write@plt>
lea    0xed5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
lea    0xed6(%rip),%rsi
mov    $0x2,%edi
mov    $0x2e,%edx
call   1030 <write@plt>
lea    0xef2(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Here is some data\0A\00"
@.str.1 = [15 x i8] c"write size=%d\0A\00"
@.str.2 = [50 x i8] c"A write error has occurred on file description 1\0A\00"
@.str.3 = [15 x i8] c"error size=%d\0A\00"
define i32 @test1() {
%1 = alloca i32
store i32 1, i32* %1
%2 = call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 19)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @write(i32 2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 46)
store i32 %5, i32* %1
%6 = load i32, i32* %1
%7 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"Here is some data\0A\00"
@.str.1 = [15 x i8] c"write size=%d\0A\00"
@.str.2 = [50 x i8] c"A write error has occurred on file description 1\0A\00"
@.str.3 = [15 x i8] c"error size=%d\0A\00"
define i32 @test1() {
%1 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 19)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%3 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 46)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int zero() {
  printf("Zero called\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [13 x i8] c"Zero called\0A\00"
define i32 @zero() {
%1 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Zero called\00"
define i32 @zero() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ endwin();
void close_ui() { endwin(); }


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

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

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

LLVM IR (-O2):
define void @close_ui() {
%1 = tail call i32 (...) @endwin()
ret void
}