xunge/DecIR huggingface dataset:
/* Type definitions */
struct sockaddr_in {
  int dummy;
};
typedef int /*<<< orphan*/ msg;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ printf(char *, int);
int send(int, char *, int, int /*<<< orphan*/);
void process_request(int in_soc, struct sockaddr_in sa) {
  char msg[] = "Thank you for using SailFish. Have a nice day. :)\n";
  int sent = send(in_soc, msg, sizeof(msg), 0);
  printf("\nWrote %d bytes over connection", sent);
  close(in_soc);
}


x86 assembly (clang, -O0):
<process_request>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %esi,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xea7(%rip),%rsi
mov    $0x33,%edx
call   1060 <memcpy@plt>
mov    -0xc(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x33,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%esi
lea    0xeb0(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%edi
call   1050 <close@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_request>:
push   %rbx
sub    $0x40,%rsp
mov    %edi,%ebx
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0xa293a,0x2f(%rsp)
mov    %rsp,%rsi
mov    $0x33,%edx
xor    %ecx,%ecx
call   1030 <send@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %ebx,%edi
call   1050 <close@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@__const.process_request.msg = [51 x i8] c"Thank you for using SailFish. Have a nice day. :)\0A\00"
@.str = [32 x i8] c"\0AWrote %d bytes over connection\00"
define void @process_request(i32 %0, i32 %1) {
%3 = alloca %struct.sockaddr_in
%4 = alloca i32
%5 = alloca [51 x i8]
%6 = alloca i32
%7 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i32 0, i32 0
store i32 %1, i32* %7
store i32 %0, i32* %4
%8 = bitcast [51 x i8]* %5 to i8*
%9 = load i32, i32* %4
%10 = getelementptr inbounds [51 x i8], [51 x i8]* %5, i64 0, i64 0
%11 = call i32 @send(i32 %9, i8* %10, i32 51, i32 0)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i32, i32* %4
%15 = call i32 @close(i32 %14)
ret void
}

LLVM IR (-O2):
@__const.process_request.msg = [51 x i8] c"Thank you for using SailFish. Have a nice day. :)\0A\00"
@.str = [32 x i8] c"\0AWrote %d bytes over connection\00"
define void @process_request(i32 %0, i32 %1) {
%3 = alloca [51 x i8]
%4 = getelementptr inbounds [51 x i8], [51 x i8]* %3, i64 0, i64 0
%5 = call i32 @send(i32 %0, i8* %4, i32 51, i32 0)
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @close(i32 %0)
ret void
}
int test_imm_F6int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0xF6 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_F6int64_midword_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, 16
%6 = and i64 %5, 246
%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_F6int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 16121856
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void print_usage(void) {
  fprintf(stderr, "Usage: ttest [-t <trunc_to>] [-w <write_at>] <filename>\n");
}


x86 assembly (clang, -O0):
<print_usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: ttest [-t <trunc_to>] [-w <write_at>] <filename>\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: ttest [-t <trunc_to>] [-w <write_at>] <filename>\0A\00"
define void @print_usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ check_is_present();
int /*<<< orphan*/ check_not_present();
int main() {
  check_not_present();
  check_is_present();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @check_not_present()
%2 = tail call i32 (...) @check_is_present()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void puts_err(char *str) { fputs(str, stderr); }


x86 assembly (clang, -O0):
<puts_err>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
call   1030 <fputs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<puts_err>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%esi
jmp    1030 <fputs@plt>

LLVM IR (-O0):
@stderr = global i32 0
define void @puts_err(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i32, i32* @stderr
%5 = call i32 @fputs(i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
define void @puts_err(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fputs(i8* %0, i32 %2)
ret void
}
/* Variables and functions */
char *sdate(char *);
char *scurrent_date() { return sdate(""); }


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @scurrent_date() {
%1 = call i8* @sdate(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @scurrent_date() {
%1 = tail call i8* @sdate(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
void stub1();
void call(void *p) { ((void (*)(void))(uintptr_t)p)(); }


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

x86 assembly (clang, -O2):
<call>:
jmp    *%rdi

LLVM IR (-O0):
define void @call(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = ptrtoint i8* %3 to i64
%5 = inttoptr i64 %4 to void ()*
ret void
}

LLVM IR (-O2):
define void @call(i8* nocapture %0) {
%2 = bitcast i8* %0 to void ()*
tail call void %2()
ret void
}
/* Variables and functions */
scalar_t__ socket(int, int, int);
int apr_socket(int family, int type, int protocol) {
  return (int)socket(family, type, protocol);
}


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

x86 assembly (clang, -O2):
<apr_socket>:
jmp    1030 <socket@plt>

LLVM IR (-O0):
define i32 @apr_socket(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i64 @socket(i32 %7, i32 %8, i32 %9)
%11 = trunc i64 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @apr_socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @socket(i32 %0, i32 %1, i32 %2)
%5 = trunc i64 %4 to i32
ret i32 %5
}
/* Variables and functions */
unsigned int sad_mx_n_c(unsigned char const *, int, unsigned char const *, int,
                        unsigned int, int, int);
unsigned int vp8_sad16x16_c(const unsigned char *src_ptr, int src_stride,
                            const unsigned char *ref_ptr, int ref_stride,
                            unsigned int max_sad) {
  return sad_mx_n_c(src_ptr, src_stride, ref_ptr, ref_stride, max_sad, 16, 16);
}


x86 assembly (clang, -O0):
<vp8_sad16x16_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    $0x10,%r9d
movl   $0x10,(%rsp)
call   1030 <sad_mx_n_c@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vp8_sad16x16_c>:
push   %rax
movl   $0x10,(%rsp)
mov    $0x10,%r9d
call   1030 <sad_mx_n_c@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @vp8_sad16x16_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = tail call i32 @sad_mx_n_c(i8* %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 16, i32 16)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int arr[4] = {0, 1, 2, 3};
  arr[40] = 4;
  printf("%d\n", arr[0]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x4,0x80(%rbp)
mov    -0x20(%rbp),%esi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void nvx_utf8vld_free(void *utf8vld) { free(utf8vld); }


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

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

LLVM IR (-O2):
define void @nvx_utf8vld_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t EPINonBlockingReadCount(uint32_t ui32Base, uint32_t ui32Channel) {
  uint32_t ui32Offset;
  ;
  ;
  ui32Offset = ui32Channel * (0x00000038 - 0x00000028);
  return ((*((volatile uint32_t *)(ui32Base + 0x00000028 + ui32Offset))));
}


x86 assembly (clang, -O0):
<EPINonBlockingReadCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x28,%eax
add    -0xc(%rbp),%eax
cltq
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<EPINonBlockingReadCount>:
movslq %esi,%rax
shl    $0x4,%rax
movslq %edi,%rcx
mov    0x28(%rcx,%rax,1),%eax
ret

LLVM IR (-O0):
define i32 @EPINonBlockingReadCount(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 16
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 40
%10 = load i32, i32* %5
%11 = add nsw i32 %9, %10
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @EPINonBlockingReadCount(i32 %0, i32 %1) {
%3 = shl nsw i32 %1, 4
%4 = add nsw i32 %0, 40
%5 = add nsw i32 %4, %3
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: -[d] <path>\n");
  fprintf(stderr, "  -d: list contents first before depth traversal\n");
  exit(2);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [20 x i8] c"usage: -[d] <path>\0A\00"
@.str.1 = [50 x i8] c" -d: list contents first before depth traversal\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [20 x i8] c"usage: -[d] <path>\0A\00"
@.str.1 = [50 x i8] c" -d: list contents first before depth traversal\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @exit(i32 2)
unreachable
}
/* Type definitions */
struct wl_shell_surface {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_marshal(struct wl_proxy *, int, char const *);
void wl_shell_surface_set_title(struct wl_shell_surface *wl_shell_surface,
                                const char *title) {
  wl_proxy_marshal((struct wl_proxy *)wl_shell_surface, 8, title);
}


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

x86 assembly (clang, -O2):
<wl_shell_surface_set_title>:
mov    %rsi,%rdx
mov    $0x8,%esi
jmp    1030 <wl_proxy_marshal@plt>

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

LLVM IR (-O2):
%struct.wl_shell_surface = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shell_surface_set_title(%struct.wl_shell_surface* %0, i8* %1) {
%3 = bitcast %struct.wl_shell_surface* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_marshal(%struct.wl_proxy* %3, i32 8, i8* %1)
ret void
}
/* Variables and functions */
char *get_argument_str(char *);
char *lw_server_get_log() {
  char *result = "";
  result = get_argument_str("log");
  return result;
}


x86 assembly (clang, -O0):
<lw_server_get_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee4(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xed6(%rip),%rdi
call   1030 <get_argument_str@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c"log\00"
define i8* @lw_server_get_log() {
%1 = tail call i8* @get_argument_str(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void *calloc(int, int);
void *ALLOC(int size) {
  void *a = calloc(1, size);
  if (a == NULL)
    abort();
  return a;
}


x86 assembly (clang, -O0):
<ALLOC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <ALLOC+0x2e>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ALLOC>:
push   %rax
mov    %edi,%esi
mov    $0x1,%edi
call   1040 <calloc@plt>
test   %rax,%rax
je     1134 <ALLOC+0x14>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @ALLOC(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @calloc(i32 1, i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @abort()
unreachable
10: ; preds = %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define noalias i8* @ALLOC(i32 %0) {
%2 = tail call i8* @calloc(i32 1, i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (...) @abort()
unreachable
6: ; preds = %1
ret i8* %2
}
/* Variables and functions */
short rand();
short rand_range16(short min, short max) {
  short range = (max - min);
  if (range == 0)
    return min;
  return min + (rand() % range);
}


x86 assembly (clang, -O0):
<rand_range16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
movswl -0x6(%rbp),%eax
movswl -0x4(%rbp),%ecx
sub    %ecx,%eax
mov    %ax,-0x8(%rbp)
movswl -0x8(%rbp),%eax
cmp    $0x0,%eax
jne    114e <rand_range16+0x3e>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    116d <rand_range16+0x5d>
movswl -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cwtl
movswl -0x8(%rbp),%ecx
cltd
idiv   %ecx
mov    -0xc(%rbp),%eax
add    %edx,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_range16>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
sub    %bx,%si
je     112a <rand_range16+0x1a>
movswl %si,%ebp
xor    %eax,%eax
call   1030 <rand@plt>
cwtl
cltd
idiv   %ebp
add    %edx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define signext i16 @rand_range16(i16 signext %0, i16 signext %1) {
%3 = sub i16 %1, %0
%4 = icmp eq i16 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = sext i16 %3 to i32
%7 = tail call signext i16 (...) @rand()
%8 = sext i16 %7 to i32
%9 = srem i32 %8, %6
%10 = trunc i32 %9 to i16
%11 = add i16 %10, %0
br label %12
12: ; preds = %2, %5
%13 = phi i16 [ %11, %5 ], [ %0, %2 ]
ret i16 %13
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t ntohll(uint64_t v) { return v; }


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

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

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

LLVM IR (-O2):
define i32 @ntohll(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
int main() {
  int x, y, suma;
  float pi;
  x = 3;
  y = 5;
  suma = x + y;
  printf("x=%d & y=%d\n", x, y);
  printf("El resultado es = %d", suma);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x5,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x3,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [13 x i8] c"x=%d & y=%d\0A\00"
@.str.1 = [21 x i8] c"El resultado es = %d\00"
define i32 @main() {
%1 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 3, i32 5)
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pthread_exit(int /*<<< orphan*/ *);
int /*<<< orphan*/ puts(char *);
void *func(void *p) {
  puts("Thread is working");
  pthread_exit(NULL);
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <pthread_exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <pthread_exit@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Thread is working\00"
define i8* @func(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @pthread_exit(i32* null)
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
@.str = [18 x i8] c"Thread is working\00"
define noalias i8* @func(i8* nocapture readnone %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @pthread_exit(i32* null)
ret i8* undef
}
/* Variables and functions */
char bitmask(const size_t bit_index) { return 1 << (bit_index % 8); }


x86 assembly (clang, -O0):
<bitmask>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
and    $0x7,%rax
mov    %eax,%ecx
mov    $0x1,%eax
shl    %cl,%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitmask>:
mov    %rdi,%rcx
and    $0x7,%cl
mov    $0x1,%al
shl    %cl,%al
ret

LLVM IR (-O0):
define signext i8 @bitmask(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = urem i64 %3, 8
%5 = trunc i64 %4 to i32
%6 = shl i32 1, %5
%7 = trunc i32 %6 to i8
ret i8 %7
}

LLVM IR (-O2):
define signext i8 @bitmask(i64 %0) {
%2 = trunc i64 %0 to i8
%3 = and i8 %2, 7
%4 = shl nuw i8 1, %3
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ expand(int /*<<< orphan*/ *, char const *, char **, int,
                          int);
void expand_out(const char *fmt, char **args, int len) {
  expand(NULL, fmt, args, len, 1);
}


x86 assembly (clang, -O0):
<expand_out>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%edi
mov    $0x1,%r8d
call   1030 <expand@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_out>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
mov    $0x1,%r8d
jmp    1030 <expand@plt>

LLVM IR (-O0):
define void @expand_out(i8* %0, i8** %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i32
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i8**, i8*** %5
%9 = load i32, i32* %6
%10 = call i32 @expand(i32* null, i8* %7, i8** %8, i32 %9, i32 1)
ret void
}

LLVM IR (-O2):
define void @expand_out(i8* %0, i8** %1, i32 %2) {
%4 = tail call i32 @expand(i32* null, i8* %0, i8** %1, i32 %2, i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cleanUpAndFail(int);
void uncompressOutOfMemory(int draw, int blockSize) { cleanUpAndFail(1); }


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

x86 assembly (clang, -O2):
<uncompressOutOfMemory>:
mov    $0x1,%edi
jmp    1030 <cleanUpAndFail@plt>

LLVM IR (-O0):
define void @uncompressOutOfMemory(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @cleanUpAndFail(i32 1)
ret void
}

LLVM IR (-O2):
define void @uncompressOutOfMemory(i32 %0, i32 %1) {
%3 = tail call i32 @cleanUpAndFail(i32 1)
ret void
}
/* Type definitions */
typedef scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ sg_put_unaligned_le64(scalar_t__, void *);
void sg_nz_put_unaligned_le64(uint64_t val, void *p) {
  if (val)
    sg_put_unaligned_le64(val, p);
}


x86 assembly (clang, -O0):
<sg_nz_put_unaligned_le64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1138 <sg_nz_put_unaligned_le64+0x28>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <sg_put_unaligned_le64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sg_nz_put_unaligned_le64>:
test   %rdi,%rdi
je     111a <sg_nz_put_unaligned_le64+0xa>
jmp    1030 <sg_put_unaligned_le64@plt>
ret

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

LLVM IR (-O2):
define void @sg_nz_put_unaligned_le64(i64 %0, i8* %1) {
%3 = icmp eq i64 %0, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @sg_put_unaligned_le64(i64 %0, i8* %1)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version(void) {
  printf("Brother scanner driver. Build "
         "Mar 17 2022"
         " "
         "23:57:03"
         "\n"
         "Copyright 2017 Dariusz Stojaczyk\n");
}


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

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

LLVM IR (-O0):
@.str = [85 x i8] c"Brother scanner driver. Build Mar 17 2022 23:57:03\0ACopyright 2017 Dariusz Stojaczyk\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [84 x i8] c"Brother scanner driver. Build Mar 17 2022 23:57:03\0ACopyright 2017 Dariusz Stojaczyk\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([84 x i8], [84 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *getenv(char const *);
char *outside_getenv(const char *name) { return getenv(name); }


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

x86 assembly (clang, -O2):
<outside_getenv>:
jmp    1030 <getenv@plt>

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

LLVM IR (-O2):
define i8* @outside_getenv(i8* nocapture %0) {
%2 = tail call i8* @getenv(i8* %0)
ret i8* %2
}
void strlwr_(char *string) {
  char *p;
  for (p = string; *p; p++)
    if ('A' <= *p && *p <= 'Z')
      *p += 'a' - 'A';
}


x86 assembly (clang, -O0):
<strlwr_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1163 <strlwr_+0x63>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
mov    $0x41,%eax
cmp    %ecx,%eax
jg     114d <strlwr_+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     114d <strlwr_+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%ecx
add    $0x20,%ecx
mov    %cl,(%rax)
jmp    1152 <strlwr_+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlwr_+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlwr_>:
mov    (%rdi),%al
test   %al,%al
je     112a <strlwr_+0x2a>
add    $0x1,%rdi
jmp    111b <strlwr_+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     112a <strlwr_+0x2a>
lea    -0x41(%rax),%ecx
cmp    $0x19,%cl
ja     1110 <strlwr_+0x10>
add    $0x20,%al
mov    %al,-0x1(%rdi)
jmp    1110 <strlwr_+0x10>
ret

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

LLVM IR (-O2):
define void @strlwr_(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -65
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nuw nsw i8 %5, 32
store i8 %10, i8* %6
br label %11
11: ; preds = %4, %9
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret void
}
/* Variables and functions */
double log(double);
double _p3dJohannsenThresholding_dlog(double x) {
  if (x > 0.0)
    return log(x);
  else
    return 0.0;
}


x86 assembly (clang, -O0):
<_p3dJohannsenThresholding_dlog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1143 <_p3dJohannsenThresholding_dlog+0x33>
movsd  -0x10(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    114b <_p3dJohannsenThresholding_dlog+0x3b>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_p3dJohannsenThresholding_dlog>:
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    111f <_p3dJohannsenThresholding_dlog+0xf>
jmp    1030 <log@plt>
xorpd  %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @_p3dJohannsenThresholding_dlog(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @log(double %7)
store double %8, double* %2
br label %10
9: ; preds = %1
store double 0.000000e+00, double* %2
br label %10
10: ; preds = %9, %6
%11 = load double, double* %2
ret double %11
}

LLVM IR (-O2):
define double @_p3dJohannsenThresholding_dlog(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @log(double %0)
br label %5
5: ; preds = %1, %3
%6 = phi double [ %4, %3 ], [ 0.000000e+00, %1 ]
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void Sys_Quit(void) { exit(0); }


x86 assembly (clang, -O0):
<Sys_Quit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

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

LLVM IR (-O0):
define void @Sys_Quit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @Sys_Quit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
int factorial(int n) {
  if (n == 0) {
    return 1;
  } else if (n < 0) {
    return 0;
  } else {
    return n * factorial(n - 1);
  }
}


x86 assembly (clang, -O0):
<factorial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <factorial+0x21>
movl   $0x1,-0x4(%rbp)
jmp    1163 <factorial+0x53>
cmpl   $0x0,-0x8(%rbp)
jge    1147 <factorial+0x37>
movl   $0x0,-0x4(%rbp)
jmp    1163 <factorial+0x53>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <factorial@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<factorial>:
mov    $0x1,%eax
test   %edi,%edi
je     1128 <factorial+0x28>
nopl   0x0(%rax)
test   %edi,%edi
js     1123 <factorial+0x23>
imul   %edi,%eax
add    $0xffffffff,%edi
jne    1110 <factorial+0x10>
mov    $0x1,%ecx
jmp    1125 <factorial+0x25>
xor    %ecx,%ecx
imul   %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @factorial(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %15, label %3
3: ; preds = %1, %7
%4 = phi i32 [ %8, %7 ], [ %0, %1 ]
%5 = phi i32 [ %9, %7 ], [ 1, %1 ]
%6 = icmp slt i32 %4, 0
br i1 %6, label %11, label %7
7: ; preds = %3
%8 = add nsw i32 %4, -1
%9 = mul nsw i32 %4, %5
%10 = icmp eq i32 %8, 0
br i1 %10, label %11, label %3
11: ; preds = %3, %7
%12 = phi i32 [ %9, %7 ], [ %5, %3 ]
%13 = phi i32 [ 1, %7 ], [ 0, %3 ]
%14 = mul nuw nsw i32 %13, %12
br label %15
15: ; preds = %11, %1
%16 = phi i32 [ %14, %11 ], [ 1, %1 ]
ret i32 %16
}
/* Variables and functions */
int ds1621_read_value(int, int);
int /*<<< orphan*/ ds1621_write_value(int, int, int);
int reset_ONE_SHOT(int dev_fd) {
  int reg;
  reg = ds1621_read_value(dev_fd, 0xAC);
  reg = reg & ~0x01;
  ds1621_write_value(dev_fd, 0xAC, reg & 0xfe);
}


x86 assembly (clang, -O0):
<reset_ONE_SHOT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0xac,%esi
call   1030 <ds1621_read_value@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfffffffe,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%edx
and    $0xfe,%edx
mov    $0xac,%esi
call   1040 <ds1621_write_value@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_ONE_SHOT>:
push   %rbx
mov    %edi,%ebx
mov    $0xac,%esi
call   1030 <ds1621_read_value@plt>
and    $0xfe,%eax
mov    %ebx,%edi
mov    $0xac,%esi
mov    %eax,%edx
pop    %rbx
jmp    1040 <ds1621_write_value@plt>

LLVM IR (-O0):
define i32 @reset_ONE_SHOT(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @ds1621_read_value(i32 %5, i32 172)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = and i32 %7, -2
store i32 %8, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = and i32 %10, 254
%12 = call i32 @ds1621_write_value(i32 %9, i32 172, i32 %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
define i32 @reset_ONE_SHOT(i32 %0) {
%2 = tail call i32 @ds1621_read_value(i32 %0, i32 172)
%3 = and i32 %2, 254
%4 = tail call i32 @ds1621_write_value(i32 %0, i32 172, i32 %3)
ret i32 undef
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ sdmmc_mask16(int, int, int);
void setckl(uint32_t data) {
  sdmmc_mask16(0x24, 0x100, 0);
  sdmmc_mask16(0x24, 0x2FF, data & 0x2FF);
  sdmmc_mask16(0x24, 0x0, 0x100);
}


x86 assembly (clang, -O0):
<setckl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x24,%edi
mov    $0x100,%esi
xor    %edx,%edx
call   1030 <sdmmc_mask16@plt>
mov    -0x4(%rbp),%edx
and    $0x2ff,%edx
mov    $0x24,%edi
mov    $0x2ff,%esi
call   1030 <sdmmc_mask16@plt>
mov    $0x24,%edi
xor    %esi,%esi
mov    $0x100,%edx
call   1030 <sdmmc_mask16@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setckl>:
push   %rbx
mov    %edi,%ebx
mov    $0x24,%edi
mov    $0x100,%esi
xor    %edx,%edx
call   1030 <sdmmc_mask16@plt>
and    $0x2ff,%ebx
mov    $0x24,%edi
mov    $0x2ff,%esi
mov    %ebx,%edx
call   1030 <sdmmc_mask16@plt>
mov    $0x24,%edi
xor    %esi,%esi
mov    $0x100,%edx
pop    %rbx
jmp    1030 <sdmmc_mask16@plt>

LLVM IR (-O0):
define void @setckl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @sdmmc_mask16(i32 36, i32 256, i32 0)
%4 = load i32, i32* %2
%5 = and i32 %4, 767
%6 = call i32 @sdmmc_mask16(i32 36, i32 767, i32 %5)
%7 = call i32 @sdmmc_mask16(i32 36, i32 0, i32 256)
ret void
}

LLVM IR (-O2):
define void @setckl(i32 %0) {
%2 = tail call i32 @sdmmc_mask16(i32 36, i32 256, i32 0)
%3 = and i32 %0, 767
%4 = tail call i32 @sdmmc_mask16(i32 36, i32 767, i32 %3)
%5 = tail call i32 @sdmmc_mask16(i32 36, i32 0, i32 256)
ret void
}
/* Variables and functions */
char getc();
int /*<<< orphan*/ putc(char);
int /*<<< orphan*/ uart_init();
int main() {
  char c;
  uart_init();
  while (1) {
    c = getc();
    putc(c + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <uart_init@plt>
mov    $0x0,%al
call   1050 <getc@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsbl %al,%edi
call   1040 <putc@plt>
jmp    1146 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <uart_init@plt>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getc@plt>
add    $0x1,%al
movsbl %al,%edi
call   1040 <putc@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (...) @uart_init()
br label %4
4: ; preds = %0, %4
%5 = call signext i8 (...) @getc()
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, 1
%9 = trunc i32 %8 to i8
%10 = call i32 @putc(i8 signext %9)
br label %4
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @uart_init()
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getc()
%4 = add i8 %3, 1
%5 = tail call i32 @putc(i8 signext %4)
br label %2
}
void reverse(char s[], int j) {
  char temp;
  int i;
  for (i = 0, j -= 1; i < j; i++, j--) {
    temp = s[i];
    s[i] = s[j];
    s[j] = temp;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1170 <reverse+0x70>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xd(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111b <reverse+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    $0x2,%esi
jl     1131 <reverse+0x31>
mov    %esi,%eax
add    $0xfffffffffffffffe,%rax
xor    %ecx,%ecx
nopl   (%rax)
movzbl (%rdi,%rcx,1),%esi
movzbl 0x1(%rdi,%rax,1),%edx
mov    %dl,(%rdi,%rcx,1)
mov    %sil,0x1(%rdi,%rax,1)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1110 <reverse+0x10>
ret

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

LLVM IR (-O2):
define void @reverse(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = add nsw i64 %5, -1
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %14, %7 ]
%9 = phi i64 [ %6, %4 ], [ %15, %7 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %8
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 %9
%13 = load i8, i8* %12
store i8 %13, i8* %10
store i8 %11, i8* %12
%14 = add nuw nsw i64 %8, 1
%15 = add nsw i64 %9, -1
%16 = icmp slt i64 %14, %15
br i1 %16, label %7, label %17
17: ; preds = %7, %2
ret void
}
int snafuscate(char *foo, int bar, int flags) {}


x86 assembly (clang, -O0):
<snafuscate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @snafuscate(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int __command(int /*<<< orphan*/, int /*<<< orphan*/, int);
int command(uint32_t driver, uint32_t command, int data) {
  return __command(driver, command, data);
}


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

x86 assembly (clang, -O2):
<command>:
jmp    1030 <__command@plt>

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

LLVM IR (-O2):
define i32 @command(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @__command(i32 %0, i32 %1, i32 %2)
ret i32 %4
}