xunge/DecIR huggingface dataset:
void rop3_98_1_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T | *D;
  stk2 = S & stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S)) | (*D & S);
}


x86 assembly (clang, -O0):
<rop3_98_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @rop3_98_1_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8, i8* %6
%11 = zext i8 %10 to i32
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = or i32 %11, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
%17 = load i8, i8* %5
%18 = zext i8 %17 to i32
%19 = load i8, i8* %9
%20 = zext i8 %19 to i32
%21 = and i32 %18, %20
%22 = trunc i32 %21 to i8
store i8 %22, i8* %8
%23 = load i8*, i8** %4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = load i8, i8* %8
%27 = zext i8 %26 to i32
%28 = xor i32 %25, %27
%29 = trunc i32 %28 to i8
store i8 %29, i8* %7
%30 = load i8, i8* %7
%31 = zext i8 %30 to i32
%32 = load i8, i8* %5
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = trunc i32 %42 to i8
%44 = load i8*, i8** %4
store i8 %43, i8* %44
ret void
}

LLVM IR (-O2):
define void @rop3_98_1_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
void TimerCompare4Set(unsigned long ulBase, unsigned long ulCompare4) {

  ;
  ;
  (*((volatile unsigned long *)(ulBase + 0x00000040))) = ulCompare4;
}


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

x86 assembly (clang, -O2):
<TimerCompare4Set>:
mov    %rsi,0x40(%rdi)
ret

LLVM IR (-O0):
define void @TimerCompare4Set(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i64, i64* %3
%7 = add i64 %6, 64
%8 = inttoptr i64 %7 to i64*
store volatile i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @TimerCompare4Set(i64 %0, i64 %1) {
%3 = add i64 %0, 64
%4 = inttoptr i64 %3 to i64*
store volatile i64 %1, i64* %4
ret void
}
/* Variables and functions */
scalar_t__ ir_read_char(int);
void ir_clear_buffer(void) {
  while (ir_read_char((50 * 1000)) >= 0)
    ;
}


x86 assembly (clang, -O0):
<ir_clear_buffer>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <ir_clear_buffer+0x9>
mov    $0xc350,%edi
call   1030 <ir_read_char@plt>
cmp    $0x0,%rax
jl     1132 <ir_clear_buffer+0x22>
jmp    1119 <ir_clear_buffer+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ir_clear_buffer>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0xc350,%edi
call   1030 <ir_read_char@plt>
test   %rax,%rax
jns    1120 <ir_clear_buffer+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @ir_clear_buffer() {
br label %1
1: ; preds = %4, %0
%2 = call i64 @ir_read_char(i32 50000)
%3 = icmp sge i64 %2, 0
br i1 %3, label %4, label %5
4: ; preds = %1
br label %1
5: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @ir_clear_buffer() {
br label %1
1: ; preds = %1, %0
%2 = tail call i64 @ir_read_char(i32 50000)
%3 = icmp sgt i64 %2, -1
br i1 %3, label %1, label %4
4: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int udpInitialize() {
  int udpSocket = socket(AF_INET, SOCK_DGRAM, 0);
  if (udpSocket <= 0) {
    perror("Unable to create socket.");
    exit(EXIT_FAILURE);
  }
  return udpSocket;
}


x86 assembly (clang, -O0):
<udpInitialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jg     1178 <udpInitialize+0x48>
lea    0xe9b(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udpInitialize>:
push   %rax
mov    0x2eb0(%rip),%rax
mov    (%rax),%edi
mov    0x2e9f(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1050 <socket@plt>
test   %eax,%eax
jle    1150 <udpInitialize+0x20>
pop    %rcx
ret
lea    0xea9(%rip),%rdi
call   1030 <perror@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [25 x i8] c"Unable to create socket.\00"
@EXIT_FAILURE = global i32 0
define i32 @udpInitialize() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_DGRAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp slt i32 %3, 1
br i1 %4, label %5, label %9
5: ; preds = %0
%6 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = tail call i32 @exit(i32 %7)
unreachable
9: ; preds = %0
ret i32 %3
}
/* Type definitions */
struct Tox_Options {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct Tox_Options *);
void tox_options_free(struct Tox_Options *options) { free(options); }


x86 assembly (clang, -O0):
<tox_options_free>:
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):
<tox_options_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.Tox_Options = type { i32 }
define void @tox_options_free(%struct.Tox_Options* %0) {
%2 = alloca %struct.Tox_Options*
store %struct.Tox_Options* %0, %struct.Tox_Options** %2
%3 = load %struct.Tox_Options*, %struct.Tox_Options** %2
%4 = call i32 @free(%struct.Tox_Options* %3)
ret void
}

LLVM IR (-O2):
%struct.Tox_Options = type { i32 }
define void @tox_options_free(%struct.Tox_Options* nocapture %0) {
%2 = tail call i32 @free(%struct.Tox_Options* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int, int /*<<< orphan*/ *);
int getc(int /*<<< orphan*/ *);
void copy(FILE *fp_in, FILE *fp_out) {
  while (feof(fp_in) == 0) {
    int input = getc(fp_in);
    fputc(input, fp_out);
  }
}


x86 assembly (clang, -O0):
<copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <feof@plt>
cmp    $0x0,%rax
jne    1170 <copy+0x40>
mov    -0x8(%rbp),%rdi
call   1050 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
jmp    1140 <copy+0x10>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
nopw   0x0(%rax,%rax,1)
call   1040 <feof@plt>
test   %rax,%rax
jne    1161 <copy+0x31>
mov    %rbx,%rdi
call   1050 <getc@plt>
mov    %eax,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
mov    %rbx,%rdi
jmp    1140 <copy+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @copy(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
br label %6
6: ; preds = %10, %2
%7 = load i32*, i32** %3
%8 = call i64 @feof(i32* %7)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = call i32 @getc(i32* %11)
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = load i32*, i32** %4
%15 = call i32 @fputc(i32 %13, i32* %14)
br label %6
16: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @copy(i32* nocapture %0, i32* nocapture %1) {
%3 = tail call i64 @feof(i32* %0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = tail call i32 @getc(i32* %0)
%7 = tail call i32 @fputc(i32 %6, i32* %1)
%8 = tail call i64 @feof(i32* %0)
%9 = icmp eq i64 %8, 0
br i1 %9, label %5, label %10
10: ; preds = %5, %2
ret void
}
/* Type definitions */
typedef void page;

/* Variables and functions */
int /*<<< orphan*/ _alloc_pages(unsigned int, unsigned int);
void *arch_validate(int /*<<< orphan*/, unsigned int, unsigned int);
struct page *alloc_pages(unsigned int gfp_mask, unsigned int order) {
  if (order >= 10)
    return ((void *)0);
  return arch_validate(_alloc_pages(gfp_mask, order), gfp_mask, order);
}


x86 assembly (clang, -O0):
<alloc_pages>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0xa,-0x10(%rbp)
jb     1145 <alloc_pages+0x25>
movq   $0x0,-0x8(%rbp)
jmp    1161 <alloc_pages+0x41>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <_alloc_pages@plt>
mov    %eax,%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <arch_validate@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alloc_pages>:
cmp    $0x9,%esi
jbe    1128 <alloc_pages+0x8>
xor    %eax,%eax
ret
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <_alloc_pages@plt>
mov    %eax,%edi
mov    %ebp,%esi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <arch_validate@plt>

LLVM IR (-O0):
%struct.page = type opaque
define %struct.page* @alloc_pages(i32 %0, i32 %1) {
%3 = alloca %struct.page*
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %5
%7 = icmp uge i32 %6, 10
br i1 %7, label %8, label %9
8: ; preds = %2
store %struct.page* null, %struct.page** %3
br label %17
9: ; preds = %2
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = call i32 @_alloc_pages(i32 %10, i32 %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %5
%15 = call i8* @arch_validate(i32 %12, i32 %13, i32 %14)
%16 = bitcast i8* %15 to %struct.page*
store %struct.page* %16, %struct.page** %3
br label %17
17: ; preds = %9, %8
%18 = load %struct.page*, %struct.page** %3
ret %struct.page* %18
}

LLVM IR (-O2):
%struct.page = type opaque
define %struct.page* @alloc_pages(i32 %0, i32 %1) {
%3 = icmp ugt i32 %1, 9
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @_alloc_pages(i32 %0, i32 %1)
%6 = tail call i8* @arch_validate(i32 %5, i32 %0, i32 %1)
%7 = bitcast i8* %6 to %struct.page*
br label %8
8: ; preds = %2, %4
%9 = phi %struct.page* [ %7, %4 ], [ null, %2 ]
ret %struct.page* %9
}
int median(int n, int hex) {
  int i = 0, tmp;
  while (n != 0) {
    tmp = n % hex;
    n = (n - tmp) / hex;
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<median>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1140 <median+0x40>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x10(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <median+0x11>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<median>:
test   %edi,%edi
je     111d <median+0x1d>
mov    %edi,%eax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
cltd
idiv   %esi
add    $0x1,%ecx
test   %eax,%eax
jne    1110 <median+0x10>
mov    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @median(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %10, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ %0, %2 ]
%6 = phi i32 [ %8, %4 ], [ 0, %2 ]
%7 = sdiv i32 %5, %1
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %7, 0
br i1 %9, label %10, label %4
10: ; preds = %4, %2
%11 = phi i32 [ 0, %2 ], [ %8, %4 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ar [commands] archive-file file...\n"
         "commands:\n"
         "  -d            - delete file(s) from the archive\n"
         "  -q            - quick append file(s) to the archive\n"
         "  -t            - display contents of archive\n"
         "  -x            - extract file(s) from the archive\n"
         "Generic Modifiers:\n"
         "  -v          - be verbose\n");
}


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

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

LLVM IR (-O0):
@.str = [300 x i8] c"Usage: ar [commands] archive-file file...\0Acommands:\0A -d - delete file(s) from the archive\0A -q - quick append file(s) to the archive\0A -t - display contents of archive\0A -x - extract file(s) from the archive\0AGeneric Modifiers:\0A -v - be verbose\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([300 x i8], [300 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [299 x i8] c"Usage: ar [commands] archive-file file...\0Acommands:\0A -d - delete file(s) from the archive\0A -q - quick append file(s) to the archive\0A -t - display contents of archive\0A -x - extract file(s) from the archive\0AGeneric Modifiers:\0A -v - be verbose\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([299 x i8], [299 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int pipe(int *);
int outside_pipe(int fds[2]) { return pipe(fds); }


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

x86 assembly (clang, -O2):
<outside_pipe>:
jmp    1030 <pipe@plt>

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

LLVM IR (-O2):
define i32 @outside_pipe(i32* %0) {
%2 = tail call i32 @pipe(i32* %0)
ret i32 %2
}
/* Type definitions */
struct b_tonegen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setMIDIDrawBar(struct b_tonegen *, int, unsigned char);
void setDrawbar9(void *d, unsigned char v) {
  setMIDIDrawBar((struct b_tonegen *)d, 9, v);
}


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

x86 assembly (clang, -O2):
<setDrawbar9>:
mov    %esi,%edx
mov    $0x9,%esi
jmp    1030 <setMIDIDrawBar@plt>

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

LLVM IR (-O2):
%struct.b_tonegen = type { i32 }
define void @setDrawbar9(i8* %0, i8 zeroext %1) {
%3 = bitcast i8* %0 to %struct.b_tonegen*
%4 = tail call i32 @setMIDIDrawBar(%struct.b_tonegen* %3, i32 9, i8 zeroext %1)
ret void
}
void do_fsave(void *p) { asm __volatile__("fsave (%0)" : : "r"(p) : "memory"); }


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

x86 assembly (clang, -O2):
<do_fsave>:
fsave  (%rdi)
ret

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

LLVM IR (-O2):
define void @do_fsave(i8* %0) {
tail call void asm sideeffect "fsave ($0)", "r,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret void
}
void c_pomp_off_() { (void)0; }


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

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

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

LLVM IR (-O2):
define void @c_pomp_off_() {
ret void
}
int cmp_ints(const void *xvp, const void *yvp) {
  int x = *(int *)xvp, y = *(int *)yvp;
  return (((x) == (y)) ? 0 : (((x) < (y)) ? -1 : 1));
}


x86 assembly (clang, -O0):
<cmp_ints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1134 <cmp_ints+0x34>
xor    %eax,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <cmp_ints+0x4c>
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%esi
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    %esi,%edx
cmovl  %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_ints>:
mov    (%rdi),%eax
xor    %ecx,%ecx
xor    %edx,%edx
cmp    (%rsi),%eax
setge  %dl
lea    -0x1(%rdx,%rdx,1),%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @cmp_ints(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %2
br label %23
17: ; preds = %2
%18 = load i32, i32* %5
%19 = load i32, i32* %6
%20 = icmp slt i32 %18, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 -1, i32 1
br label %23
23: ; preds = %17, %16
%24 = phi i32 [ 0, %16 ], [ %22, %17 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @cmp_ints(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp eq i32 %4, %6
%8 = icmp slt i32 %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
int handle_app_exit(int read_fd, int write_fd, struct child_cmd *cmd) {}


x86 assembly (clang, -O0):
<handle_app_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.child_cmd = type opaque
define i32 @handle_app_exit(i32 %0, i32 %1, %struct.child_cmd* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.child_cmd*
store i32 %0, i32* %5
store i32 %1, i32* %6
store %struct.child_cmd* %2, %struct.child_cmd** %7
%8 = load i32, i32* %4
ret i32 %8
}

LLVM IR (-O2):
%struct.child_cmd = type opaque
define i32 @handle_app_exit(i32 %0, i32 %1, %struct.child_cmd* nocapture readnone %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
char *canonicalize(char const *, char *);
char *__realpath(const char *name, char *resolved) {
  if (resolved == NULL) {
    __set_errno(EINVAL);
    return NULL;
  }
  return canonicalize(name, resolved);
}


x86 assembly (clang, -O0):
<__realpath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1156 <__realpath+0x36>
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
movq   $0x0,-0x8(%rbp)
jmp    1167 <__realpath+0x47>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <canonicalize@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__realpath>:
test   %rsi,%rsi
je     112a <__realpath+0xa>
jmp    1040 <canonicalize@plt>
push   %rax
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@EINVAL = global i32 0
define i8* @__realpath(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i32, i32* @EINVAL
%10 = call i32 @__set_errno(i32 %9)
store i8* null, i8** %3
br label %15
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i8* @canonicalize(i8* %12, i8* %13)
store i8* %14, i8** %3
br label %15
15: ; preds = %11, %8
%16 = load i8*, i8** %3
ret i8* %16
}

LLVM IR (-O2):
@EINVAL = global i32 0
define i8* @__realpath(i8* %0, i8* %1) {
%3 = icmp eq i8* %1, null
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i32, i32* @EINVAL
%6 = tail call i32 @__set_errno(i32 %5)
br label %9
7: ; preds = %2
%8 = tail call i8* @canonicalize(i8* %0, i8* %1)
br label %9
9: ; preds = %7, %4
%10 = phi i8* [ null, %4 ], [ %8, %7 ]
ret i8* %10
}
int check_handler() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @check_handler() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ a();
int /*<<< orphan*/ b();
int /*<<< orphan*/ c();
int /*<<< orphan*/ d();
int /*<<< orphan*/ f(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                     int /*<<< orphan*/);
main() { f(a(), b(), c(), d()); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1070 <a@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <b@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1060 <c@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <d@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    %eax,%ecx
call   1050 <f@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1070 <a@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1040 <b@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <c@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <d@plt>
mov    %r14d,%edi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
call   1050 <f@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @a()
%2 = call i32 (...) @b()
%3 = call i32 (...) @c()
%4 = call i32 (...) @d()
%5 = call i32 @f(i32 %1, i32 %2, i32 %3, i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @a()
%2 = tail call i32 (...) @b()
%3 = tail call i32 (...) @c()
%4 = tail call i32 (...) @d()
%5 = tail call i32 @f(i32 %1, i32 %2, i32 %3, i32 %4)
ret i32 0
}
int rt(int instruction) { return (instruction >> 16) & 0x0000001f; }


x86 assembly (clang, -O0):
<rt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0x1f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rt>:
mov    %edi,%eax
shr    $0x10,%eax
and    $0x1f,%eax
ret

LLVM IR (-O0):
define i32 @rt(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = and i32 %4, 31
ret i32 %5
}

LLVM IR (-O2):
define i32 @rt(i32 %0) {
%2 = lshr i32 %0, 16
%3 = and i32 %2, 31
ret i32 %3
}
int thrackle_size(int n) {
  switch (n) {
  case 3:
    return 1;
  case 4:
    return 1;
  case 5:
    return 2;
  case 6:
    return 4;
  case 7:
    return 7;
  case 8:
    return 8;
  case 9:
    return 10;
  default:
    return -1;
  }
}


x86 assembly (clang, -O0):
<thrackle_size>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xfffffffd,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x6,%eax
ja     1184 <thrackle_size+0x84>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x1,-0x4(%rbp)
jmp    118b <thrackle_size+0x8b>
movl   $0x1,-0x4(%rbp)
jmp    118b <thrackle_size+0x8b>
movl   $0x2,-0x4(%rbp)
jmp    118b <thrackle_size+0x8b>
movl   $0x4,-0x4(%rbp)
jmp    118b <thrackle_size+0x8b>
movl   $0x7,-0x4(%rbp)
jmp    118b <thrackle_size+0x8b>
movl   $0x8,-0x4(%rbp)
jmp    118b <thrackle_size+0x8b>
movl   $0xa,-0x4(%rbp)
jmp    118b <thrackle_size+0x8b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<thrackle_size>:
add    $0xfffffffd,%edi
mov    $0xffffffff,%eax
cmp    $0x6,%edi
ja     111a <thrackle_size+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @thrackle_size(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %12 [
i32 3, label %5
i32 4, label %6
i32 5, label %7
i32 6, label %8
i32 7, label %9
i32 8, label %10
i32 9, label %11
]
5: ; preds = %1
store i32 1, i32* %2
br label %13
6: ; preds = %1
store i32 1, i32* %2
br label %13
7: ; preds = %1
store i32 2, i32* %2
br label %13
8: ; preds = %1
store i32 4, i32* %2
br label %13
9: ; preds = %1
store i32 7, i32* %2
br label %13
10: ; preds = %1
store i32 8, i32* %2
br label %13
11: ; preds = %1
store i32 10, i32* %2
br label %13
12: ; preds = %1
store i32 -1, i32* %2
br label %13
13: ; preds = %12, %11, %10, %9, %8, %7, %6, %5
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
@switch.table.thrackle_size = [7 x i32] [i32 1, i32 1, i32 2, i32 4, i32 7, i32 8, i32 10]
define i32 @thrackle_size(i32 %0) {
%2 = add i32 %0, -3
%3 = icmp ult i32 %2, 7
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds [7 x i32], [7 x i32]* @switch.table.thrackle_size, i64 0, i64 %5
%7 = load i32, i32* %6
br label %8
8: ; preds = %1, %4
%9 = phi i32 [ %7, %4 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
scalar_t__ stb__wildmatch_raw(char *, char *, int /*<<< orphan*/, int);
int stb_wildmatchi(char *expr, char *candidate) {
  return stb__wildmatch_raw(expr, candidate, 0, 1) >= 0;
}


x86 assembly (clang, -O0):
<stb_wildmatchi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %edx,%edx
mov    $0x1,%ecx
call   1030 <stb__wildmatch_raw@plt>
cmp    $0x0,%rax
setge  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @stb_wildmatchi(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i64 @stb__wildmatch_raw(i8* %5, i8* %6, i32 0, i32 1)
%8 = icmp sge i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @stb_wildmatchi(i8* %0, i8* %1) {
%3 = tail call i64 @stb__wildmatch_raw(i8* %0, i8* %1, i32 0, i32 1)
%4 = lshr i64 %3, 63
%5 = trunc i64 %4 to i32
%6 = xor i32 %5, 1
ret i32 %6
}
/* Variables and functions */
int system(char *);
int g_system(char *aexec) { return system(aexec); }


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

x86 assembly (clang, -O2):
<g_system>:
jmp    1030 <system@plt>

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

LLVM IR (-O2):
define i32 @g_system(i8* nocapture %0) {
%2 = tail call i32 @system(i8* %0)
ret i32 %2
}
struct pn_sock *pn_sk(struct sock *sk) {
  return (struct pn_sock *)sk;
}


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

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

LLVM IR (-O0):
%struct.pn_sock = type opaque
%struct.sock = type opaque
define %struct.pn_sock* @pn_sk(%struct.sock* %0) {
%2 = alloca %struct.sock*
store %struct.sock* %0, %struct.sock** %2
%3 = load %struct.sock*, %struct.sock** %2
%4 = bitcast %struct.sock* %3 to %struct.pn_sock*
ret %struct.pn_sock* %4
}

LLVM IR (-O2):
%struct.pn_sock = type opaque
%struct.sock = type opaque
define %struct.pn_sock* @pn_sk(%struct.sock* readnone %0) {
%2 = bitcast %struct.sock* %0 to %struct.pn_sock*
ret %struct.pn_sock* %2
}
/* Variables and functions */
int /*<<< orphan*/ getNextToken();
scalar_t__ matchToken(int);
void declarAssignment() {
  if (matchToken(400)) {
    getNextToken();
    if (matchToken(506)) {
      getNextToken();
    }
  }
}


x86 assembly (clang, -O0):
<declarAssignment>:
push   %rbp
mov    %rsp,%rbp
mov    $0x190,%edi
call   1040 <matchToken@plt>
cmp    $0x0,%rax
je     115f <declarAssignment+0x3f>
mov    $0x0,%al
call   1030 <getNextToken@plt>
mov    $0x1fa,%edi
call   1040 <matchToken@plt>
cmp    $0x0,%rax
je     115a <declarAssignment+0x3a>
mov    $0x0,%al
call   1030 <getNextToken@plt>
jmp    115f <declarAssignment+0x3f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<declarAssignment>:
push   %rax
mov    $0x190,%edi
call   1040 <matchToken@plt>
test   %rax,%rax
je     114e <declarAssignment+0x2e>
xor    %eax,%eax
call   1030 <getNextToken@plt>
mov    $0x1fa,%edi
call   1040 <matchToken@plt>
test   %rax,%rax
je     114e <declarAssignment+0x2e>
xor    %eax,%eax
pop    %rcx
jmp    1030 <getNextToken@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @declarAssignment() {
%1 = call i64 @matchToken(i32 400)
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = call i32 (...) @getNextToken()
%5 = call i64 @matchToken(i32 506)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = call i32 (...) @getNextToken()
br label %9
9: ; preds = %7, %3
br label %10
10: ; preds = %9, %0
ret void
}

LLVM IR (-O2):
define void @declarAssignment() {
%1 = tail call i64 @matchToken(i32 400)
%2 = icmp eq i64 %1, 0
br i1 %2, label %9, label %3
3: ; preds = %0
%4 = tail call i32 (...) @getNextToken()
%5 = tail call i64 @matchToken(i32 506)
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 (...) @getNextToken()
br label %9
9: ; preds = %3, %7, %0
ret void
}
char *Q_strupr(char *s) {
  char *p;
  if (s) {
    for (p = s; *s; s++)
      *s = toupper(*s);
    return p;
  }
  return ((void *)0);
}


x86 assembly (clang, -O0):
<Q_strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     116e <Q_strupr+0x5e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1161 <Q_strupr+0x51>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112f <Q_strupr+0x1f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1176 <Q_strupr+0x66>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
test   %rdi,%rdi
je     1146 <Q_strupr+0x36>
mov    (%r14),%al
test   %al,%al
je     1146 <Q_strupr+0x36>
lea    0x1(%r14),%rbx
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <toupper@plt>
mov    %al,-0x1(%rbx)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <Q_strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @Q_strupr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %15, label %3
3: ; preds = %1
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %3, %6
%7 = phi i8 [ %13, %6 ], [ %4, %3 ]
%8 = phi i8* [ %12, %6 ], [ %0, %3 ]
%9 = sext i8 %7 to i32
%10 = tail call i32 @toupper(i32 %9)
%11 = trunc i32 %10 to i8
store i8 %11, i8* %8
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %6
15: ; preds = %6, %3, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ IsSeparator(char const);
const char *ScanToken(const char *token, char chr) {
  while (!IsSeparator(*token)) {
    if (*token == chr)
      return token;
    token++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<ScanToken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <IsSeparator@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1143 <ScanToken+0x33>
jmp    1174 <ScanToken+0x64>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    1163 <ScanToken+0x53>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    117c <ScanToken+0x6c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1122 <ScanToken+0x12>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ScanToken>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
movsbl (%rdi),%edi
nopl   0x0(%rax,%rax,1)
call   1030 <IsSeparator@plt>
test   %eax,%eax
jne    1138 <ScanToken+0x28>
cmp    %bpl,(%rbx)
je     113a <ScanToken+0x2a>
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
jmp    1120 <ScanToken+0x10>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ScanToken(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
br label %6
6: ; preds = %21, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = call i32 @IsSeparator(i8 signext %8)
%10 = icmp ne i32 %9, 0
%11 = xor i1 %10, true
br i1 %11, label %12, label %24
12: ; preds = %6
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = load i8, i8* %5
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %15, %17
br i1 %18, label %19, label %21
19: ; preds = %12
%20 = load i8*, i8** %4
store i8* %20, i8** %3
br label %25
21: ; preds = %12
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %4
br label %6
24: ; preds = %6
store i8* null, i8** %3
br label %25
25: ; preds = %24, %19
%26 = load i8*, i8** %3
ret i8* %26
}

LLVM IR (-O2):
define i8* @ScanToken(i8* %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = tail call i32 @IsSeparator(i8 signext %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %2, %10
%7 = phi i8* [ %11, %10 ], [ %0, %2 ]
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, %1
br i1 %9, label %15, label %10
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = tail call i32 @IsSeparator(i8 signext %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %6, label %15
15: ; preds = %6, %10, %2
%16 = phi i8* [ null, %2 ], [ null, %10 ], [ %7, %6 ]
ret i8* %16
}
unsigned char f56(unsigned char x, long int y) {
  return (x << ((-y) & (8 - 1))) ^ (x >> y);
}


x86 assembly (clang, -O0):
<f56>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
movzbl -0x1(%rbp),%eax
xor    %ecx,%ecx
sub    -0x10(%rbp),%rcx
and    $0x7,%rcx
shl    %cl,%eax
movzbl -0x1(%rbp),%edx
mov    -0x10(%rbp),%rcx
sar    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f56>:
mov    %esi,%ecx
neg    %cl
and    $0x7,%cl
mov    %edi,%eax
shl    %cl,%eax
mov    %esi,%ecx
shr    %cl,%edi
xor    %edi,%eax
ret

LLVM IR (-O0):
define zeroext i8 @f56(i8 zeroext %0, i64 %1) {
%3 = alloca i8
%4 = alloca i64
store i8 %0, i8* %3
store i64 %1, i64* %4
%5 = load i8, i8* %3
%6 = zext i8 %5 to i32
%7 = load i64, i64* %4
%8 = sub nsw i64 0, %7
%9 = and i64 %8, 7
%10 = trunc i64 %9 to i32
%11 = shl i32 %6, %10
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = load i64, i64* %4
%15 = trunc i64 %14 to i32
%16 = ashr i32 %13, %15
%17 = xor i32 %11, %16
%18 = trunc i32 %17 to i8
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @f56(i8 zeroext %0, i64 %1) {
%3 = zext i8 %0 to i32
%4 = trunc i64 %1 to i32
%5 = sub i32 0, %4
%6 = and i32 %5, 7
%7 = shl nuw nsw i32 %3, %6
%8 = lshr i32 %3, %4
%9 = xor i32 %7, %8
%10 = trunc i32 %9 to i8
ret i8 %10
}
/* Variables and functions */
char *f(char *);
int /*<<< orphan*/ printf(char *, int);
void g(const char *s) {
  printf("%d", 123);
  printf("%d %d", 123);
  printf(f("%d"), 123);
  printf(f("%d %d"), 123);
}


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xed0(%rip),%rdi
mov    $0x7b,%esi
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x7b,%esi
call   1040 <printf@plt>
lea    0xeae(%rip),%rdi
call   1030 <f@plt>
mov    %rax,%rdi
mov    $0x7b,%esi
call   1040 <printf@plt>
lea    0xe92(%rip),%rdi
call   1030 <f@plt>
mov    %rax,%rdi
mov    $0x7b,%esi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
push   %r14
push   %rbx
push   %rax
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x7b,%esi
call   1040 <printf@plt>
lea    0xec1(%rip),%r14
mov    %r14,%rdi
mov    $0x7b,%esi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <f@plt>
mov    %rax,%rdi
mov    $0x7b,%esi
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <f@plt>
mov    %rax,%rdi
mov    $0x7b,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [6 x i8] c"%d %d\00"
define void @g(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 123)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 123)
%4 = tail call i8* @f(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* %4, i32 123)
%6 = tail call i8* @f(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @printf(i8* %6, i32 123)
ret void
}
/* Variables and functions */
int INT_MAX;
int /*<<< orphan*/ this_comparison_is_not_decidable();
void bla4le(int var) {
  if (var - 10 <= INT_MAX - 11)
    this_comparison_is_not_decidable();
}


x86 assembly (clang, -O0):
<bla4le>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
mov    0x2ec0(%rip),%rcx
mov    (%rcx),%ecx
sub    $0xb,%ecx
cmp    %ecx,%eax
jg     113c <bla4le+0x2c>
mov    $0x0,%al
call   1030 <this_comparison_is_not_decidable@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bla4le>:
mov    0x2ed1(%rip),%rax
cmp    %edi,(%rax)
jle    1122 <bla4le+0x12>
xor    %eax,%eax
jmp    1030 <this_comparison_is_not_decidable@plt>
ret

LLVM IR (-O0):
@INT_MAX = global i32 0
define void @bla4le(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 10
%5 = load i32, i32* @INT_MAX
%6 = sub nsw i32 %5, 11
%7 = icmp sle i32 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @this_comparison_is_not_decidable()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
@INT_MAX = global i32 0
define void @bla4le(i32 %0) {
%2 = load i32, i32* @INT_MAX
%3 = icmp sgt i32 %2, %0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @this_comparison_is_not_decidable()
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
void stop(char *file, int line) {
  fprintf(stderr, "--- STOP called - %s line %d ---\n\n", file, line);
  exit(1);
}


x86 assembly (clang, -O0):
<stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2eaa(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<stop>:
push   %rax
mov    %esi,%ecx
mov    %rdi,%rdx
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
lea    0xeca(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"--- STOP called - %s line %d ---\0A\0A\00"
define void @stop(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"--- STOP called - %s line %d ---\0A\0A\00"
define void @stop(i8* %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
bool is_big_endian() {
  int a = 0x1234;
  char b = *(char *)&a;
  if (b == 0x12) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_big_endian>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1234,-0x8(%rbp)
mov    -0x8(%rbp),%al
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x12,%eax
jne    112a <is_big_endian+0x2a>
movl   $0x1,-0x4(%rbp)
jmp    1131 <is_big_endian+0x31>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @is_big_endian() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 4660, i32* %2
%4 = bitcast i32* %2 to i8*
%5 = load i8, i8* %4
store i8 %5, i8* %3
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 18
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %1
br label %11
10: ; preds = %0
store i32 0, i32* %1
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %1
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_big_endian() {
ret i32 0
}
void do_pushb_pos(void) {
  unsigned long long int block[3];
  __asm__ __volatile__("movq  %0, %%rdx\n\t"
                       "pushq $0x55555555\n\t"
                       "movq  %%rsp, 0(%%rdx)\n\t"
                       ".byte 0x6A,0x22\n\t"
                       "movq  %%rsp, 8(%%rdx)\n\t"
                       "popq  %%rax\n\t"
                       "movq  %%rax,16(%%rdx)\n\t"
                       "movq  0(%%rdx),%%rsp\n\t"
                       "addq  $8, %%rsp"
                       :
                       : "r"(&block)
                       : "rax", "rdx", "cc", "memory");
  printf("  pushb_pos: delta %lld, top64 0x%016llx\n", block[0] - block[1],
         block[2]);
}


x86 assembly (clang, -O0):
<do_pushb_pos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rcx
mov    %rcx,%rdx
push   $0x55555555
mov    %rsp,(%rdx)
push   $0x22
mov    %rsp,0x8(%rdx)
pop    %rax
mov    %rax,0x10(%rdx)
mov    (%rdx),%rsp
add    $0x8,%rsp
mov    -0x20(%rbp),%rsi
sub    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_pushb_pos>:
sub    $0x18,%rsp
mov    %rsp,%rcx
mov    %rcx,%rdx
push   $0x55555555
mov    %rsp,(%rdx)
push   $0x22
mov    %rsp,0x8(%rdx)
pop    %rax
mov    %rax,0x10(%rdx)
mov    (%rdx),%rsp
add    $0x8,%rsp
mov    (%rsp),%rsi
mov    0x10(%rsp),%rdx
sub    0x8(%rsp),%rsi
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [42 x i8] c" pushb_pos: delta %lld, top64 0x%016llx\0A\00"
define void @do_pushb_pos() {
%1 = alloca [3 x i64]
%2 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 0
%3 = load i64, i64* %2
%4 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 1
%5 = load i64, i64* %4
%6 = sub i64 %3, %5
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 2
%8 = load i64, i64* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %6, i64 %8)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c" pushb_pos: delta %lld, top64 0x%016llx\0A\00"
define void @do_pushb_pos() {
%1 = alloca [3 x i64]
%2 = bitcast [3 x i64]* %1 to i8*
%3 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 0
%4 = load i64, i64* %3
%5 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 1
%6 = load i64, i64* %5
%7 = sub i64 %4, %6
%8 = getelementptr inbounds [3 x i64], [3 x i64]* %1, i64 0, i64 2
%9 = load i64, i64* %8
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %9)
ret void
}