xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
char *base64(int /*<<< orphan*/ *, int, int *);
int /*<<< orphan*/ *cipher_aes_encrypt(unsigned char const *, int, int *,
                                       int /*<<< orphan*/ const *);
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
char *cipher_aes_b64_encrypt(const unsigned char *in, int inlen, int *outb64len,
                             const uint8_t *key) {
  int outlen;
  uint8_t *encrypt = cipher_aes_encrypt(in, inlen, &outlen, key);
  char *b64;
  b64 = base64(encrypt, outlen, outb64len);
  free(encrypt);
  return b64;
}


x86 assembly (clang, -O0):
<cipher_aes_b64_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x20(%rbp),%rcx
lea    -0x24(%rbp),%rdx
call   1050 <cipher_aes_encrypt@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1040 <base64@plt>
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cipher_aes_b64_encrypt>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
lea    0x4(%rsp),%rdx
call   1050 <cipher_aes_encrypt@plt>
mov    %rax,%rbx
mov    0x4(%rsp),%esi
mov    %rax,%rdi
mov    %r14,%rdx
call   1040 <base64@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @cipher_aes_b64_encrypt(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca i8*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%12 = load i8*, i8** %5
%13 = load i32, i32* %6
%14 = load i32*, i32** %8
%15 = call i32* @cipher_aes_encrypt(i8* %12, i32 %13, i32* %9, i32* %14)
store i32* %15, i32** %10
%16 = load i32*, i32** %10
%17 = load i32, i32* %9
%18 = load i32*, i32** %7
%19 = call i8* @base64(i32* %16, i32 %17, i32* %18)
store i8* %19, i8** %11
%20 = load i32*, i32** %10
%21 = call i32 @free(i32* %20)
%22 = load i8*, i8** %11
ret i8* %22
}

LLVM IR (-O2):
define i8* @cipher_aes_b64_encrypt(i8* %0, i32 %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
%7 = call i32* @cipher_aes_encrypt(i8* %0, i32 %1, i32* %5, i32* %3)
%8 = load i32, i32* %5
%9 = call i8* @base64(i32* %7, i32 %8, i32* %2)
%10 = call i32 @free(i32* %7)
ret i8* %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void *thread_func(void *arg) {
  printf("this is thread\n");
  return NULL;
}


x86 assembly (clang, -O0):
<thread_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"this is thread\0A\00"
define i8* @thread_func(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@str = [15 x i8] c"this is thread\00"
define noalias i8* @thread_func(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
char *ins_str(char *, int);
int strlen(char *);
char *simple_string(char *src) {
  int len = strlen(src);
  return ins_str(src, len);
}


x86 assembly (clang, -O0):
<simple_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <ins_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simple_string>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ins_str@plt>

LLVM IR (-O0):
define i8* @simple_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
store i32 %5, i32* %3
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = call i8* @ins_str(i8* %6, i32 %7)
ret i8* %8
}

LLVM IR (-O2):
define i8* @simple_string(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i8* @ins_str(i8* %0, i32 %2)
ret i8* %3
}
unsigned int fn1(signed int a) { return (unsigned int)a - ((a / 3) * 3); }


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
imul   $0x3,%ecx,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @fn1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 3
%6 = mul nsw i32 %5, 3
%7 = sub i32 %3, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @fn1(i32 %0) {
%2 = srem i32 %0, 3
ret i32 %2
}
int main(void) {
  int i;
  double d;
  d = 4.4;
  i = d;
  return i;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movsd  0xeed(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
cvttsd2si -0x10(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
store i32 0, i32* %1
store double 4.400000e+00, double* %3
%4 = load double, double* %3
%5 = fptosi double %4 to i32
store i32 %5, i32* %2
%6 = load i32, i32* %2
ret i32 %6
}

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

/* Variables and functions */
uint32_t is_ebp_inuse(uint32_t bitmap) { return (bitmap & (0x1 << 7)); }


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

x86 assembly (clang, -O2):
<is_ebp_inuse>:
mov    %edi,%eax
and    $0x80,%eax
ret

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

LLVM IR (-O2):
define i32 @is_ebp_inuse(i32 %0) {
%2 = and i32 %0, 128
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
main() {
  long int sum = 0;
  int a = sizeof(int);
  int b = sizeof(long);
  int c = sizeof(double);
  printf("%d\n", a);
  printf("%d\n", b);
  printf("%d\n", c);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x8,-0x10(%rbp)
movl   $0x8,-0x14(%rbp)
mov    -0xc(%rbp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x8,%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 i64
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i64 0, i64* %1
store i32 4, i32* %2
store i32 8, i32* %3
store i32 8, i32* %4
%5 = load i32, i32* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32, i32* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
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 4)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 8)
ret i32 0
}
void RTAvlULGetBestFit(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlULGetBestFit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ error(char *);
int send(int, char const *, size_t, int /*<<< orphan*/);
void write_message(int fd, const char *message, size_t msg_len) {
  if (send(fd, message, msg_len, 0) == -1)
    error("Could not send message to server");
}


x86 assembly (clang, -O0):
<write_message>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
jne    115a <write_message+0x3a>
lea    0xeab(%rip),%rdi
call   1040 <error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_message>:
push   %rax
xor    %ecx,%ecx
call   1030 <send@plt>
cmp    $0xffffffff,%eax
je     112f <write_message+0xf>
pop    %rax
ret
lea    0xeca(%rip),%rdi
pop    %rax
jmp    1040 <error@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"Could not send message to server\00"
define void @write_message(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @send(i32 %7, i8* %8, i64 %9, i32 0)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %3
%13 = call i32 @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12, %3
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"Could not send message to server\00"
define void @write_message(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @send(i32 %0, i8* %1, i64 %2, i32 0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @error(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ gaussian(int const, int const, int const,
                            int /*<<< orphan*/ *, float *, float *,
                            int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void pencil_gaussian(const int rows, const int cols, const int step,
                     uint8_t src[], float kernelX[], float kernelY[],
                     uint8_t temp[], uint8_t conv[]) {
  gaussian(rows, cols, step, src, kernelX, kernelY, temp, conv);
}


x86 assembly (clang, -O0):
<pencil_gaussian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <gaussian@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pencil_gaussian>:
jmp    1030 <gaussian@plt>

LLVM IR (-O0):
define void @pencil_gaussian(i32 %0, i32 %1, i32 %2, i32* %3, float* %4, float* %5, i32* %6, i32* %7) {
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32*
%13 = alloca float*
%14 = alloca float*
%15 = alloca i32*
%16 = alloca i32*
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32* %3, i32** %12
store float* %4, float** %13
store float* %5, float** %14
store i32* %6, i32** %15
store i32* %7, i32** %16
%17 = load i32, i32* %9
%18 = load i32, i32* %10
%19 = load i32, i32* %11
%20 = load i32*, i32** %12
%21 = load float*, float** %13
%22 = load float*, float** %14
%23 = load i32*, i32** %15
%24 = load i32*, i32** %16
%25 = call i32 @gaussian(i32 %17, i32 %18, i32 %19, i32* %20, float* %21, float* %22, i32* %23, i32* %24)
ret void
}

LLVM IR (-O2):
define void @pencil_gaussian(i32 %0, i32 %1, i32 %2, i32* %3, float* %4, float* %5, i32* %6, i32* %7) {
%9 = tail call i32 @gaussian(i32 %0, i32 %1, i32 %2, i32* %3, float* %4, float* %5, i32* %6, i32* %7)
ret void
}
/* Variables and functions */
size_t round_up(size_t val, size_t align) {
  return (val + align - 1) & ~(align - 1);
}


x86 assembly (clang, -O0):
<round_up>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
sub    $0x1,%rax
mov    -0x10(%rbp),%rcx
sub    $0x1,%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_up>:
lea    (%rdi,%rsi,1),%rax
add    $0xffffffffffffffff,%rax
neg    %rsi
and    %rsi,%rax
ret

LLVM IR (-O0):
define i64 @round_up(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = add i64 %5, %6
%8 = sub i64 %7, 1
%9 = load i64, i64* %4
%10 = sub i64 %9, 1
%11 = xor i64 %10, -1
%12 = and i64 %8, %11
ret i64 %12
}

LLVM IR (-O2):
define i64 @round_up(i64 %0, i64 %1) {
%3 = add i64 %0, -1
%4 = add i64 %3, %1
%5 = sub i64 0, %1
%6 = and i64 %4, %5
ret i64 %6
}
/* Variables and functions */
char *make_return_packet(int /*<<< orphan*/);
char *gdb_read_reg(int reg) { return (make_return_packet(0)); }


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

x86 assembly (clang, -O2):
<gdb_read_reg>:
xor    %edi,%edi
jmp    1030 <make_return_packet@plt>

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

LLVM IR (-O2):
define i8* @gdb_read_reg(i32 %0) {
%2 = tail call i8* @make_return_packet(i32 0)
ret i8* %2
}
void bit_accuracy() {}


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

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

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

LLVM IR (-O2):
define void @bit_accuracy() {
ret void
}
void pathconN_nm4_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @pathconN_nm4_decref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void usage(char *name) {
  printf("%s [OPTIONS]\n\n", name);
  printf("\t-c\t display current setting\n");
  printf("\t-d\t decrease brightness\n");
  printf("\t-i\t increase brightness\n\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
lea    0xef4(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%s [OPTIONS]\0A\0A\00"
@.str.1 = [30 x i8] c"\09-c\09 display current setting\0A\00"
@.str.2 = [26 x i8] c"\09-d\09 decrease brightness\0A\00"
@.str.3 = [27 x i8] c"\09-i\09 increase brightness\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"%s [OPTIONS]\0A\0A\00"
@str = [29 x i8] c"\09-c\09 display current setting\00"
@str.4 = [25 x i8] c"\09-d\09 decrease brightness\00"
@str.5 = [26 x i8] c"\09-i\09 increase brightness\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.4, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.5, i64 0, i64 0))
ret void
}
/* Variables and functions */
int debug_msg();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void debug_say(char *msg) {
  if (debug_msg() == 1)
    fprintf(stderr, "%s\n", msg);
  return;
}


x86 assembly (clang, -O0):
<debug_say>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <debug_msg@plt>
cmp    $0x1,%eax
jne    1155 <debug_say+0x35>
mov    0x2e9d(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_say>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <debug_msg@plt>
cmp    $0x1,%eax
jne    1149 <debug_say+0x29>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    %rbx,%rdx
pop    %rbx
jmp    1040 <fprintf@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define void @debug_say(i8* %0) {
%2 = tail call i32 (...) @debug_msg()
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
br label %7
7: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t smpte_hbrmt_get_video_payload_scrambling(const uint8_t *p_hbrmt) {
  return (p_hbrmt[2] >> 4) & 0x3;
}


x86 assembly (clang, -O0):
<smpte_hbrmt_get_video_payload_scrambling>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
sar    $0x4,%eax
and    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smpte_hbrmt_get_video_payload_scrambling>:
mov    0x8(%rdi),%eax
shr    $0x4,%eax
and    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @smpte_hbrmt_get_video_payload_scrambling(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 2
%5 = load i32, i32* %4
%6 = ashr i32 %5, 4
%7 = and i32 %6, 3
ret i32 %7
}

LLVM IR (-O2):
define i32 @smpte_hbrmt_get_video_payload_scrambling(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 4
%5 = and i32 %4, 3
ret i32 %5
}
/* Type definitions */
struct event_base {
  int dummy;
};
struct event {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ event_base_loopexit(struct event_base *,
                                       int /*<<< orphan*/ *);
struct event_base *event_get_base(struct event *);
int /*<<< orphan*/ printf(char *);
void signal_callback(int fd, short events, void *arg) {
  struct event *signal = arg;
  struct event_base *base = event_get_base(signal);
  printf("You are Die!\n");
  event_base_loopexit(base, NULL);
}


x86 assembly (clang, -O0):
<signal_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <event_get_base@plt>
mov    %rax,-0x20(%rbp)
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <event_base_loopexit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signal_callback>:
push   %rbx
mov    %rdx,%rdi
call   1050 <event_get_base@plt>
mov    %rax,%rbx
lea    0xebd(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1040 <event_base_loopexit@plt>

LLVM IR (-O0):
%struct.event = type { i32 }
%struct.event_base = type { i32 }
@.str = [14 x i8] c"You are Die!\0A\00"
define void @signal_callback(i32 %0, i16 signext %1, i8* %2) {
%4 = alloca i32
%5 = alloca i16
%6 = alloca i8*
%7 = alloca %struct.event*
%8 = alloca %struct.event_base*
store i32 %0, i32* %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%9 = load i8*, i8** %6
%10 = bitcast i8* %9 to %struct.event*
store %struct.event* %10, %struct.event** %7
%11 = load %struct.event*, %struct.event** %7
%12 = call %struct.event_base* @event_get_base(%struct.event* %11)
store %struct.event_base* %12, %struct.event_base** %8
%13 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%14 = load %struct.event_base*, %struct.event_base** %8
%15 = call i32 @event_base_loopexit(%struct.event_base* %14, i32* null)
ret void
}

LLVM IR (-O2):
%struct.event = type { i32 }
%struct.event_base = type { i32 }
@str = [13 x i8] c"You are Die!\00"
define void @signal_callback(i32 %0, i16 signext %1, i8* %2) {
%4 = bitcast i8* %2 to %struct.event*
%5 = tail call %struct.event_base* @event_get_base(%struct.event* %4)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @event_base_loopexit(%struct.event_base* %5, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void say_hello(const char *name) { printf("Hello %s!\n", name); }


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

x86 assembly (clang, -O2):
<say_hello>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [11 x i8] c"Hello %s!\0A\00"
define void @say_hello(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
unsigned int hash_str(char const *, int, int);
unsigned int hash_djb2(const char *s) { return hash_str(s, 5381, 33); }


x86 assembly (clang, -O0):
<hash_djb2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1505,%esi
mov    $0x21,%edx
call   1030 <hash_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_djb2>:
mov    $0x1505,%esi
mov    $0x21,%edx
jmp    1030 <hash_str@plt>

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

LLVM IR (-O2):
define i32 @hash_djb2(i8* %0) {
%2 = tail call i32 @hash_str(i8* %0, i32 5381, i32 33)
ret i32 %2
}
int main() {
  int a = 3;
  int b = (a > 3 ? 4 : 0) ? 5 : 1;
  return b;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
xor    %edx,%edx
mov    $0x4,%eax
cmp    $0x3,%ecx
cmovg  %eax,%edx
mov    $0x1,%eax
mov    $0x5,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 3
%6 = zext i1 %5 to i64
%7 = select i1 %5, i32 4, i32 0
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 5, i32 1
store i32 %10, i32* %3
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int __ctype_islower(int);
int islower(int c) { return __ctype_islower(c); }


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

x86 assembly (clang, -O2):
<islower>:
jmp    1030 <__ctype_islower@plt>

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

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = tail call i32 @__ctype_islower(i32 %0)
ret i32 %2
}
int sfindlc(char *str, char ch) {
  int i;
  int ret = -1;
  for (i = 0; str[i]; i++)
    if (str[i] == ch)
      ret = i;
  return ret;
}


x86 assembly (clang, -O0):
<sfindlc>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     115f <sfindlc+0x5f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    114c <sfindlc+0x4c>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1151 <sfindlc+0x51>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111c <sfindlc+0x1c>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sfindlc>:
mov    (%rdi),%cl
mov    $0xffffffff,%eax
test   %cl,%cl
je     1123 <sfindlc+0x23>
xor    %edx,%edx
nopl   (%rax)
cmp    %sil,%cl
cmove  %edx,%eax
movzbl 0x1(%rdi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <sfindlc+0x10>
ret

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

LLVM IR (-O2):
define i32 @sfindlc(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %12, %5 ], [ 0, %2 ]
%7 = phi i8 [ %14, %5 ], [ %3, %2 ]
%8 = phi i32 [ %11, %5 ], [ -1, %2 ]
%9 = icmp eq i8 %7, %1
%10 = trunc i64 %6 to i32
%11 = select i1 %9, i32 %10, i32 %8
%12 = add nuw nsw i64 %6, 1
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = icmp eq i8 %14, 0
br i1 %15, label %16, label %5
16: ; preds = %5, %2
%17 = phi i32 [ -1, %2 ], [ %11, %5 ]
ret i32 %17
}
int test_imm_ABint64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xAB << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_ABint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 734439407616
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d%d\n", &a, &b);
  printf("%d %d\n", a * b, 2 * (a + b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
imul   -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
add    -0xc(%rbp),%edx
shl    $0x1,%edx
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    (%rsp),%edx
mov    %edx,%esi
imul   %eax,%esi
add    %eax,%edx
add    %edx,%edx
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d%d\0A\00"
@.str.1 = [7 x i8] c"%d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, %6
%9 = add nsw i32 %7, %6
%10 = shl nsw i32 %9, 1
%11 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 %10)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ sqlite3;

/* Variables and functions */
int /*<<< orphan*/ closedatabase(int /*<<< orphan*/ *);
unsigned int countapps(int /*<<< orphan*/ *);
int /*<<< orphan*/ opendatabase(int /*<<< orphan*/ **);
unsigned int db_countapps(void) {
  sqlite3 *db;
  unsigned int count;
  opendatabase(&db);
  count = countapps(db);
  closedatabase(db);
  return count;
}


x86 assembly (clang, -O0):
<db_countapps>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
call   1040 <opendatabase@plt>
mov    -0x8(%rbp),%rdi
call   1030 <countapps@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <closedatabase@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_countapps>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdi
call   1040 <opendatabase@plt>
mov    0x8(%rsp),%rdi
call   1030 <countapps@plt>
mov    %eax,%ebx
mov    0x8(%rsp),%rdi
call   1050 <closedatabase@plt>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @db_countapps() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32 @opendatabase(i32** %1)
%4 = load i32*, i32** %1
%5 = call i32 @countapps(i32* %4)
store i32 %5, i32* %2
%6 = load i32*, i32** %1
%7 = call i32 @closedatabase(i32* %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @db_countapps() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
%3 = call i32 @opendatabase(i32** %1)
%4 = load i32*, i32** %1
%5 = call i32 @countapps(i32* %4)
%6 = load i32*, i32** %1
%7 = call i32 @closedatabase(i32* %6)
ret i32 %5
}
void constrain_aspect_ratio_via_xlib() {}


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

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

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

LLVM IR (-O2):
define void @constrain_aspect_ratio_via_xlib() {
ret void
}
int Media_SetAdvancedAspect(char *format) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @Media_SetAdvancedAspect(i8* nocapture readnone %0) {
ret i32 0
}
int test_imm_9Fuint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x9F << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_9Fuint64_midword_reg>:
test   $0x9f0000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Fuint64_midword_reg(i64 %0) {
%2 = and i64 %0, 10420224
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int S_ISREG(int /*<<< orphan*/);
int s_isreg(mode_t mode) { return S_ISREG(mode); }


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

x86 assembly (clang, -O2):
<s_isreg>:
jmp    1030 <S_ISREG@plt>

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

LLVM IR (-O2):
define i32 @s_isreg(i32 %0) {
%2 = tail call i32 @S_ISREG(i32 %0)
ret i32 %2
}
/* Type definitions */
typedef char *int32_t;

/* Variables and functions */
int32_t ENDSWAP_32(int32_t x) {
  int32_t y;
  __asm__("bswap %0" : "=r"(y) : "0"(x));
  return y;
}


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

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

LLVM IR (-O0):
define i8* @ENDSWAP_32(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
ret i8* %6
}

LLVM IR (-O2):
define i8* @ENDSWAP_32(i8* readnone %0) {
%2 = tail call i8* asm "bswap $0", "=r,0,~{dirflag},~{fpsr},~{flags}"(i8* %0)
ret i8* %2
}
/* Variables and functions */
scalar_t__ memcmp(void const *, char const *, int);
int filemapIsScript(const void *addr, size_t size) {
  const char scriptMagic[] = "#!";
  if (size >= (signed)(sizeof scriptMagic - 1) &&
      memcmp(addr, scriptMagic, sizeof scriptMagic - 1) == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<filemapIsScript>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    0xed9(%rip),%ax
mov    %ax,-0x1b(%rbp)
mov    0xed1(%rip),%al
mov    %al,-0x19(%rbp)
cmpq   $0x2,-0x18(%rbp)
jb     1167 <filemapIsScript+0x57>
mov    -0x10(%rbp),%rdi
lea    -0x1b(%rbp),%rsi
mov    $0x2,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
jne    1167 <filemapIsScript+0x57>
movl   $0x1,-0x4(%rbp)
jmp    116e <filemapIsScript+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filemapIsScript>:
push   %rax
movb   $0x0,0x6(%rsp)
movw   $0x2123,0x4(%rsp)
cmp    $0x2,%rsi
jb     1137 <filemapIsScript+0x27>
lea    0x4(%rsp),%rsi
mov    $0x2,%edx
call   1030 <memcmp@plt>
test   %rax,%rax
je     113b <filemapIsScript+0x2b>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.filemapIsScript.scriptMagic = [3 x i8] c"#!\00"
define i32 @filemapIsScript(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca [3 x i8]
store i8* %0, i8** %4
store i64 %1, i64* %5
%7 = bitcast [3 x i8]* %6 to i8*
%8 = load i64, i64* %5
%9 = icmp uge i64 %8, 2
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%13 = call i64 @memcmp(i8* %11, i8* %12, i32 2)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %3
br label %17
16: ; preds = %10, %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@__const.filemapIsScript.scriptMagic = [3 x i8] c"#!\00"
define i32 @filemapIsScript(i8* %0, i64 %1) {
%3 = alloca [3 x i8]
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%5 = icmp ugt i64 %1, 1
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = call i64 @memcmp(i8* %0, i8* %4, i32 2)
%8 = icmp eq i64 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %6, %2
br label %10
10: ; preds = %6, %9
%11 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ re_compile(char const *);
int re_matchp(int /*<<< orphan*/, char const *);
int re_match(const char *pattern, const char *text) {
  return re_matchp(re_compile(pattern), text);
}


x86 assembly (clang, -O0):
<re_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <re_compile@plt>
mov    %eax,%edi
mov    -0x10(%rbp),%rsi
call   1040 <re_matchp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_match>:
push   %rbx
mov    %rsi,%rbx
call   1030 <re_compile@plt>
mov    %eax,%edi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <re_matchp@plt>

LLVM IR (-O0):
define i32 @re_match(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 = call i32 @re_compile(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @re_matchp(i32 %6, i8* %7)
ret i32 %8
}

LLVM IR (-O2):
define i32 @re_match(i8* %0, i8* %1) {
%3 = tail call i32 @re_compile(i8* %0)
%4 = tail call i32 @re_matchp(i32 %3, i8* %1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ T_FMT;
char *nl_langinfo(int /*<<< orphan*/);
char *langinfo_t_fmt() { return nl_langinfo(T_FMT); }


x86 assembly (clang, -O0):
<langinfo_t_fmt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <nl_langinfo@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<langinfo_t_fmt>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <nl_langinfo@plt>

LLVM IR (-O0):
@T_FMT = global i32 0
define i8* @langinfo_t_fmt() {
%1 = load i32, i32* @T_FMT
%2 = call i8* @nl_langinfo(i32 %1)
ret i8* %2
}

LLVM IR (-O2):
@T_FMT = global i32 0
define i8* @langinfo_t_fmt() {
%1 = load i32, i32* @T_FMT
%2 = tail call i8* @nl_langinfo(i32 %1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_LDA();
void do0x3A() { _I8080_LDA(); }


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

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

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

LLVM IR (-O2):
define void @do0x3A() {
%1 = tail call i32 (...) @_I8080_LDA()
ret void
}
/* Type definitions */
typedef int wint_t;

/* Variables and functions */
int iswprint(wint_t wc) {
  return (wc >= 0 && wc < 128 ? wc >= ' ' && wc <= '~' : 1);
}


x86 assembly (clang, -O0):
<iswprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1147 <iswprint+0x47>
cmpl   $0x80,-0x4(%rbp)
jge    1147 <iswprint+0x47>
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1137 <iswprint+0x37>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <iswprint+0x54>
mov    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1154 <iswprint+0x54>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iswprint>:
cmp    $0x20,%edi
setge  %al
cmp    $0x7f,%edi
seta   %cl
setne  %dl
and    %al,%dl
or     %cl,%dl
movzbl %dl,%eax
ret

LLVM IR (-O0):
define i32 @iswprint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %17
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 128
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 32
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 126
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
br label %18
17: ; preds = %5, %1
br label %18
18: ; preds = %17, %14
%19 = phi i32 [ %16, %14 ], [ 1, %17 ]
ret i32 %19
}

LLVM IR (-O2):
define i32 @iswprint(i32 %0) {
%2 = icmp ugt i32 %0, 127
%3 = icmp sgt i32 %0, 31
%4 = icmp ne i32 %0, 127
%5 = and i1 %3, %4
%6 = or i1 %2, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
numeric(str) char *str;
{
  for (; *str; str++) {
    if (*str > '9' || *str < '0') {
      return (0);
    }
  }
  return (1);
}


x86 assembly (clang, -O0):
<numeric>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1157 <numeric+0x57>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jg     1135 <numeric+0x35>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jge    1141 <numeric+0x41>
movl   $0x0,-0x4(%rbp)
jmp    115e <numeric+0x5e>
jmp    1146 <numeric+0x46>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1108 <numeric+0x8>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<numeric>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <numeric+0x23>
add    $0x1,%rdi
nop
add    $0xc6,%cl
cmp    $0xf5,%cl
jbe    1124 <numeric+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <numeric+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @numeric(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %7
4: ; preds = %7
%5 = load i8, i8* %12
%6 = icmp eq i8 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %12, %4 ], [ %0, %1 ]
%10 = add i8 %8, -58
%11 = icmp ult i8 %10, -10
%12 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %11, label %13, label %4
13: ; preds = %7, %4, %1
%14 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ CmdLO_InitCmd(char, int /*<<< orphan*/);
void CmdLO_Init(char addhelp) { CmdLO_InitCmd(addhelp, 0); }


x86 assembly (clang, -O0):
<CmdLO_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
xor    %esi,%esi
movsbl -0x1(%rbp),%edi
call   1030 <CmdLO_InitCmd@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdLO_Init>:
xor    %esi,%esi
jmp    1030 <CmdLO_InitCmd@plt>

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

LLVM IR (-O2):
define void @CmdLO_Init(i8 signext %0) {
%2 = tail call i32 @CmdLO_InitCmd(i8 signext %0, i32 0)
ret void
}
/* Variables and functions */
int rn_group(int, int);
int puorg_rn(int p2, int p1) { return rn_group(p1, p2); }


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

x86 assembly (clang, -O2):
<puorg_rn>:
mov    %edi,%eax
mov    %esi,%edi
mov    %eax,%esi
jmp    1030 <rn_group@plt>

LLVM IR (-O0):
define i32 @puorg_rn(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @rn_group(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @puorg_rn(i32 %0, i32 %1) {
%3 = tail call i32 @rn_group(i32 %1, i32 %0)
ret i32 %3
}