xunge/DecIR huggingface dataset:
unsigned char f79(unsigned char x, int y) {
  return (x << y) + (x >> ((-y) & (8 * sizeof(unsigned char) - 1)));
}


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

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

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

LLVM IR (-O2):
define zeroext i8 @f79(i8 zeroext %0, i32 %1) {
%3 = zext i8 %0 to i32
%4 = shl i32 %3, %1
%5 = sub nsw i32 0, %1
%6 = and i32 %5, 7
%7 = lshr i32 %3, %6
%8 = add nsw i32 %7, %4
%9 = trunc i32 %8 to i8
ret i8 %9
}
/* Variables and functions */
int do_smbus_send_byte(int, unsigned int, unsigned char);
int smbusx_send_byte(unsigned smb_index, unsigned device, unsigned char val) {
  return do_smbus_send_byte(0x1000 + (smb_index << 8), device, val);
}


x86 assembly (clang, -O0):
<smbusx_send_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x4(%rbp),%edi
shl    $0x8,%edi
add    $0x1000,%edi
mov    -0x8(%rbp),%esi
movzbl -0x9(%rbp),%edx
call   1030 <do_smbus_send_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smbusx_send_byte>:
shl    $0x8,%edi
add    $0x1000,%edi
jmp    1030 <do_smbus_send_byte@plt>

LLVM IR (-O0):
define i32 @smbusx_send_byte(i32 %0, i32 %1, i8 zeroext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8 %2, i8* %6
%7 = load i32, i32* %4
%8 = shl i32 %7, 8
%9 = add i32 4096, %8
%10 = load i32, i32* %5
%11 = load i8, i8* %6
%12 = call i32 @do_smbus_send_byte(i32 %9, i32 %10, i8 zeroext %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @smbusx_send_byte(i32 %0, i32 %1, i8 zeroext %2) {
%4 = shl i32 %0, 8
%5 = add i32 %4, 4096
%6 = tail call i32 @do_smbus_send_byte(i32 %5, i32 %1, i8 zeroext %2)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void charfunc(char a) { printf("char: %c\n", a); }


x86 assembly (clang, -O0):
<charfunc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
lea    0xedb(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<charfunc>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [10 x i8] c"char: %c\0A\00"
define void @charfunc(i8 signext %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8 signext %0)
ret void
}
/* Type definitions */
typedef int int8_t;

/* Variables and functions */
size_t aeron_res_header_address_length(int8_t res_type) {
  return (0x02) == res_type ? (16u) : (4u);
}


x86 assembly (clang, -O0):
<aeron_res_header_address_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    $0x2,%edx
mov    $0x4,%eax
mov    $0x10,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
mov    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeron_res_header_address_length>:
cmp    $0x2,%edi
mov    $0x10,%ecx
mov    $0x4,%eax
cmove  %rcx,%rax
ret

LLVM IR (-O0):
define i64 @aeron_res_header_address_length(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 2, %3
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 16, i32 4
%7 = zext i32 %6 to i64
ret i64 %7
}

LLVM IR (-O2):
define i64 @aeron_res_header_address_length(i32 %0) {
%2 = icmp eq i32 %0, 2
%3 = select i1 %2, i64 16, i64 4
ret i64 %3
}
/* Variables and functions */
scalar_t__ rand();
float random_float(void) { return (float)rand(); }


x86 assembly (clang, -O0):
<random_float>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_float>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @random_float() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to float
ret float %2
}

LLVM IR (-O2):
define float @random_float() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to float
ret float %2
}
__attribute__((no, noclone)) int foo(int a, int b) {
  if (a)
    return -3;
  asm volatile goto("bts $1, %0; jc %l[lab]" : : "m"(b) : "memory" : lab);
  return 0;
lab:
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1120 <foo+0x20>
movl   $0xfffffffd,-0x4(%rbp)
jmp    1143 <foo+0x43>
btsl   $0x1,-0xc(%rbp)
jb     113c <foo+0x3c>
jmp    1130 <foo+0x30>
movl   $0x0,-0x4(%rbp)
jmp    1143 <foo+0x43>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %esi,-0x4(%rsp)
mov    $0xfffffffd,%eax
test   %edi,%edi
je     110e <foo+0xe>
ret
xor    %eax,%eax
btsl   $0x1,-0x4(%rsp)
jb     110d <foo+0xd>
ret

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = alloca i32
store i32 %1, i32* %3
%4 = icmp eq i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %2
to label %7 [label %6]
6: ; preds = %5
br label %7
7: ; preds = %5, %2, %6
%8 = phi i32 [ 0, %6 ], [ -3, %2 ], [ 0, %5 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ do_test(int, char **);
int /*<<< orphan*/ init_prolog();
int main(int argc, char **argv) {
  init_prolog();
  do_test(argc, argv);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <init_prolog@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1040 <do_test@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @init_prolog()
%7 = load i32, i32* %4
%8 = load i8**, i8*** %5
%9 = call i32 @do_test(i32 %7, i8** %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 (...) @init_prolog()
%4 = tail call i32 @do_test(i32 %0, i8** %1)
ret i32 0
}
/* Variables and functions */
char *escape_string_internal(char *, int);
char *escape_string_single_quote(char *s) {
  return escape_string_internal(s, 1);
}


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

x86 assembly (clang, -O2):
<escape_string_single_quote>:
mov    $0x1,%esi
jmp    1030 <escape_string_internal@plt>

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

LLVM IR (-O2):
define i8* @escape_string_single_quote(i8* %0) {
%2 = tail call i8* @escape_string_internal(i8* %0, i32 1)
ret i8* %2
}
/* Variables and functions */
long double strtod_i8n(char const *, char **);
long double strtold_i8n(const char *str, char **endptr) {
  return strtod_i8n(str, endptr);
}


x86 assembly (clang, -O0):
<strtold_i8n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strtod_i8n@plt>
fld    %st(0)
fstp   %st(0)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strtold_i8n>:
jmp    1030 <strtod_i8n@plt>

LLVM IR (-O0):
define x86_fp80 @strtold_i8n(i8* %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i8**
store i8* %0, i8** %3
store i8** %1, i8*** %4
%5 = load i8*, i8** %3
%6 = load i8**, i8*** %4
%7 = call x86_fp80 @strtod_i8n(i8* %5, i8** %6)
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @strtold_i8n(i8* %0, i8** %1) {
%3 = tail call x86_fp80 @strtod_i8n(i8* %0, i8** %1)
ret x86_fp80 %3
}
/* Type definitions */
struct wl_shm {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void wl_shm_set_user_data(struct wl_shm *wl_shm, void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)wl_shm, user_data);
}


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

x86 assembly (clang, -O2):
<wl_shm_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

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

LLVM IR (-O2):
%struct.wl_shm = type { i32 }
%struct.wl_proxy = type { i32 }
define void @wl_shm_set_user_data(%struct.wl_shm* %0, i8* %1) {
%3 = bitcast %struct.wl_shm* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
/* Variables and functions */
scalar_t__ strverscmp(char const *, char *);
const char *asn1_check_version(const char *req_version) {
  if (!req_version || strverscmp(req_version, "2.10") <= 0)
    return "2.10";
  return NULL;
}


x86 assembly (clang, -O0):
<asn1_check_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1141 <asn1_check_version+0x31>
mov    -0x10(%rbp),%rdi
lea    0xece(%rip),%rsi
call   1030 <strverscmp@plt>
cmp    $0x0,%rax
jg     1151 <asn1_check_version+0x41>
lea    0xeb8(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1159 <asn1_check_version+0x49>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asn1_check_version>:
test   %rdi,%rdi
je     1133 <asn1_check_version+0x23>
push   %rbx
lea    0xee3(%rip),%rbx
mov    %rbx,%rsi
call   1030 <strverscmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
cmovle %rbx,%rax
pop    %rbx
ret
lea    0xec6(%rip),%rax
ret

LLVM IR (-O0):
@.str = [5 x i8] c"2.10\00"
define i8* @asn1_check_version(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i64 @strverscmp(i8* %7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = icmp sle i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %6, %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %2
br label %12
11: ; preds = %6
store i8* null, i8** %2
br label %12
12: ; preds = %11, %10
%13 = load i8*, i8** %2
ret i8* %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"2.10\00"
define i8* @asn1_check_version(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @strverscmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp slt i64 %4, 1
%6 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* null
br label %7
7: ; preds = %3, %1
%8 = phi i8* [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), %1 ], [ %6, %3 ]
ret i8* %8
}
float hpa2inhg(float hpa) { return hpa * (1.0f / 33.8639f); }


x86 assembly (clang, -O0):
<hpa2inhg>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hpa2inhg>:
mulss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @hpa2inhg(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3F9E3D1AE0000000
ret float %4
}

LLVM IR (-O2):
define float @hpa2inhg(float %0) {
%2 = fmul float %0, 0x3F9E3D1AE0000000
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int search(int *, int, int);
int main(void) {
  int arr[] = {4, 5, 6, 7, 0, 1, 2};
  printf("%d\n", search(arr, 7, 4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
mov    $0x4,%edx
call   1040 <search@plt>
mov    %eax,%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movups 0xee1(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x7,%esi
mov    $0x4,%edx
call   1040 <search@plt>
lea    0xec8(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
@__const.main.arr = [7 x i32] [i32 4, i32 5, i32 6, i32 7, i32 0, i32 1, i32 2]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [7 x i32]
%2 = bitcast [7 x i32]* %1 to i8*
%3 = getelementptr inbounds [7 x i32], [7 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 7, i32 4)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int);
void test_dcl_blank() {
  test_parser_verify_parse(test_parser_sourcefile("dcl", "\n"), "dcl", "", "",
                           1);
}


x86 assembly (clang, -O0):
<test_dcl_blank>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebe(%rip),%rcx
mov    $0x1,%r8d
mov    %rcx,%rdx
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dcl_blank>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed5(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec7(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
mov    %rcx,%rdx
mov    $0x1,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"dcl\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_dcl_blank() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 1)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"dcl\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [1 x i8] zeroinitializer
define void @test_dcl_blank() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void mod1_print() { printf("Hello from mod1\n"); }


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

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

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

LLVM IR (-O2):
@str = [16 x i8] c"Hello from mod1\00"
define void @mod1_print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
main() { printf("%1.3f\n", 3.14159265359); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"%1.3f\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 0x400921FB54442EEA)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%1.3f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 0x400921FB54442EEA)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ sched_yield();
void YabThreadYield(void) { sched_yield(); }


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

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

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

LLVM IR (-O2):
define void @YabThreadYield() {
%1 = tail call i32 (...) @sched_yield()
ret void
}
void cs_dummy(void) { return; }


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

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

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

LLVM IR (-O2):
define void @cs_dummy() {
ret void
}
unsigned int deviceRobotSonarDetectorGetSoftwareRevision(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @deviceRobotSonarDetectorGetSoftwareRevision() {
ret i32 1
}

LLVM IR (-O2):
define i32 @deviceRobotSonarDetectorGetSoftwareRevision() {
ret i32 1
}
int util_num_bits(unsigned int val) {
  int i;
  while (val >>= 1)
    i++;
  return i;
}


x86 assembly (clang, -O0):
<util_num_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
je     1127 <util_num_bits+0x27>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1107 <util_num_bits+0x7>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_num_bits>:
cmp    $0x2,%edi
jb     111c <util_num_bits+0x1c>
mov    %edi,%ecx
nopw   0x0(%rax,%rax,1)
shr    %ecx
add    $0x1,%eax
cmp    $0x3,%edi
mov    %ecx,%edi
ja     1110 <util_num_bits+0x10>
ret

LLVM IR (-O0):
define i32 @util_num_bits(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
br label %4
4: ; preds = %8, %1
%5 = load i32, i32* %2
%6 = lshr i32 %5, 1
store i32 %6, i32* %2
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
define i32 @util_num_bits(i32 %0) {
%2 = icmp ult i32 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ undef, %1 ]
%5 = phi i32 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i32 %5, 1
%7 = add nsw i32 %4, 1
%8 = icmp ult i32 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ undef, %1 ], [ %7, %3 ]
ret i32 %10
}
int test_imm_21int16_mem(short *val) {
  return ((*val) & (-0x21 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_21int16_mem>:
movzwl (%rdi),%eax
test   $0xffdf,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_21int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -33
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ funct(char *);
main() { funct('-' - '-' + "cic test is an easy nut to crack"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"cic test is an easy nut to crack\00"
define i32 @main() {
%1 = call i32 @funct(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"cic test is an easy nut to crack\00"
define i32 @main() {
%1 = tail call i32 @funct(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int stub1();
void test_wrapper(char *test_name, int (*f)(void)) {
  printf("\nTesting %s... ", test_name);
  int status = (*f)();
  if (status)
    printf("\x1B[32m"
           "passed."
           "\x1B[0m");
  else
    printf("\x1B[31m"
           "failed; test aborted."
           "\x1B[0m");
}


x86 assembly (clang, -O0):
<test_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
call   *-0x10(%rbp)
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1155 <test_wrapper+0x45>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1163 <test_wrapper+0x53>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_wrapper>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
call   *%rbx
test   %eax,%eax
lea    0xef1(%rip),%rax
lea    0xed9(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\0ATesting %s... \00"
@.str.1 = [17 x i8] c"\1B[32mpassed.\1B[0m\00"
@.str.2 = [31 x i8] c"\1B[31mfailed; test aborted.\1B[0m\00"
define void @test_wrapper(i8* %0, i32 ()* %1) {
%3 = alloca i8*
%4 = alloca i32 ()*
%5 = alloca i32
store i8* %0, i8** %3
store i32 ()* %1, i32 ()** %4
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i32 ()*, i32 ()** %4
%9 = call i32 %8()
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %16
14: ; preds = %2
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"\0ATesting %s... \00"
@.str.1 = [17 x i8] c"\1B[32mpassed.\1B[0m\00"
@.str.2 = [31 x i8] c"\1B[31mfailed; test aborted.\1B[0m\00"
define void @test_wrapper(i8* %0, i32 ()* nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 %1()
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %6)
ret void
}
char *hideemail_get_extra_token(void *userdata, int *delta) {
  *delta = 0;
  return 0;
}


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

x86 assembly (clang, -O2):
<hideemail_get_extra_token>:
movl   $0x0,(%rsi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define noalias i8* @hideemail_get_extra_token(i8* nocapture readnone %0, i32* nocapture writeonly %1) {
store i32 0, i32* %1
ret i8* null
}
int get_n() { return 4; }


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

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

LLVM IR (-O0):
define i32 @get_n() {
ret i32 4
}

LLVM IR (-O2):
define i32 @get_n() {
ret i32 4
}
/* Variables and functions */
int /*<<< orphan*/ Atm128Rfa1Uart1InterruptsP__Uart1Interrupts__setSendData();
void Atm128Rfa1SerialP__Uart1Interrupts__setSendData(void) {
  Atm128Rfa1Uart1InterruptsP__Uart1Interrupts__setSendData();
}


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

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

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

LLVM IR (-O2):
define void @Atm128Rfa1SerialP__Uart1Interrupts__setSendData() {
%1 = tail call i32 (...) @Atm128Rfa1Uart1InterruptsP__Uart1Interrupts__setSendData()
ret void
}
/* Variables and functions */
char *format_initial_capital_delimiter(char *, char *, char,
                                       int /*<<< orphan*/);
char *format_initial_capital_not_parens(char *destination, char *string) {
  return format_initial_capital_delimiter(destination, string, ' ', 0);
}


x86 assembly (clang, -O0):
<format_initial_capital_not_parens>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x20,%edx
xor    %ecx,%ecx
call   1030 <format_initial_capital_delimiter@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<format_initial_capital_not_parens>:
mov    $0x20,%edx
xor    %ecx,%ecx
jmp    1030 <format_initial_capital_delimiter@plt>

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

LLVM IR (-O2):
define i8* @format_initial_capital_not_parens(i8* %0, i8* %1) {
%3 = tail call i8* @format_initial_capital_delimiter(i8* %0, i8* %1, i8 signext 32, i32 0)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char *);
char *strrchr(char *, char);
int sid_replacelast(char *sidt, char *new) {
  char *p;
  if ((p = strrchr(sidt, '-')) == NULL)
    return 0;
  p++;
  strcpy(p, new);
  return 1;
}


x86 assembly (clang, -O0):
<sid_replacelast>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2d,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    1158 <sid_replacelast+0x38>
movl   $0x0,-0x4(%rbp)
jmp    1178 <sid_replacelast+0x58>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcpy@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sid_replacelast>:
push   %rbx
mov    %rsi,%rbx
mov    $0x2d,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1149 <sid_replacelast+0x29>
add    $0x1,%rax
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @sid_replacelast(i8* %0, i8* %1) {
%3 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 45)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %3, i64 1
%7 = tail call i32 @strcpy(i8* %6, i8* %1)
br label %8
8: ; preds = %2, %5
%9 = phi i32 [ 1, %5 ], [ 0, %2 ]
ret i32 %9
}
void sort_swap(int list[], int i, int j) {
  int hold = list[i];
  list[i] = list[j];
  list[j] = hold;
}


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

x86 assembly (clang, -O2):
<sort_swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @sort_swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @sort_swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
void _infix_operator_div_i16_i16(signed short lhs, signed short rhs,
                                 signed short *__rval_1) {
  *__rval_1 = lhs / rhs;
}


x86 assembly (clang, -O0):
<_infix_operator_div_i16_i16>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
mov    %rdx,-0x10(%rbp)
movswl -0x2(%rbp),%eax
movswl -0x4(%rbp),%ecx
cltd
idiv   %ecx
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_infix_operator_div_i16_i16>:
mov    %rdx,%rcx
mov    %edi,%eax
cltd
idiv   %esi
mov    %ax,(%rcx)
ret

LLVM IR (-O0):
define void @_infix_operator_div_i16_i16(i16 signext %0, i16 signext %1, i16* %2) {
%4 = alloca i16
%5 = alloca i16
%6 = alloca i16*
store i16 %0, i16* %4
store i16 %1, i16* %5
store i16* %2, i16** %6
%7 = load i16, i16* %4
%8 = sext i16 %7 to i32
%9 = load i16, i16* %5
%10 = sext i16 %9 to i32
%11 = sdiv i32 %8, %10
%12 = trunc i32 %11 to i16
%13 = load i16*, i16** %6
store i16 %12, i16* %13
ret void
}

LLVM IR (-O2):
define void @_infix_operator_div_i16_i16(i16 signext %0, i16 signext %1, i16* nocapture writeonly %2) {
%4 = sext i16 %0 to i32
%5 = sext i16 %1 to i32
%6 = sdiv i32 %4, %5
%7 = trunc i32 %6 to i16
store i16 %7, i16* %2
ret void
}
int ft_strlen(char *str) {
  int len;
  len = 0;
  while (str[len]) {
    len++;
  }
  return (len);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     112f <ft_strlen+0x2f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
void gtk_tree_selection_selected_foreach() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_selection_selected_foreach() {
ret void
}
int fun427() { return 427; }


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

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

LLVM IR (-O0):
define i32 @fun427() {
ret i32 427
}

LLVM IR (-O2):
define i32 @fun427() {
ret i32 427
}
/* Variables and functions */
int /*<<< orphan*/ encrypt(char *, int);
char *decrypt(char *text, int key) { encrypt(text, -key); }


x86 assembly (clang, -O0):
<decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
sub    -0x14(%rbp),%esi
call   1030 <encrypt@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrypt>:
neg    %esi
jmp    1030 <encrypt@plt>

LLVM IR (-O0):
define i8* @decrypt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
%6 = load i8*, i8** %4
%7 = load i32, i32* %5
%8 = sub nsw i32 0, %7
%9 = call i32 @encrypt(i8* %6, i32 %8)
%10 = load i8*, i8** %3
ret i8* %10
}

LLVM IR (-O2):
define noalias i8* @decrypt(i8* %0, i32 %1) {
%3 = sub nsw i32 0, %1
%4 = tail call i32 @encrypt(i8* %0, i32 %3)
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ clean_exit();
void signal_exit(int signum __attribute__((unused))) { clean_exit(); }


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

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

LLVM IR (-O0):
define void @signal_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @clean_exit()
ret void
}

LLVM IR (-O2):
define void @signal_exit(i32 %0) {
%2 = tail call i32 (...) @clean_exit()
ret void
}
void gtk_action_group_new() {}


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

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

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

LLVM IR (-O2):
define void @gtk_action_group_new() {
ret void
}
void w13(void *x, double y) { *(double *)(x + 32755) = y; }


x86 assembly (clang, -O0):
<w13>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x7ff3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<w13>:
movsd  %xmm0,0x7ff3(%rdi)
ret

LLVM IR (-O0):
define void @w13(i8* %0, double %1) {
%3 = alloca i8*
%4 = alloca double
store i8* %0, i8** %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load i8*, i8** %3
%7 = getelementptr i8, i8* %6, i64 32755
%8 = bitcast i8* %7 to double*
store double %5, double* %8
ret void
}

LLVM IR (-O2):
define void @w13(i8* nocapture writeonly %0, double %1) {
%3 = getelementptr i8, i8* %0, i64 32755
%4 = bitcast i8* %3 to double*
store double %1, double* %4
ret void
}
/* Variables and functions */
void *ft_memset(void *b, int c, size_t len) {
  size_t i;
  unsigned char *ptr;
  i = 0;
  ptr = b;
  while (i < len) {
    ptr[i] = (unsigned char)c;
    i++;
  }
  return (b);
}


x86 assembly (clang, -O0):
<ft_memset>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    114e <ft_memset+0x4e>
mov    -0xc(%rbp),%eax
mov    %al,%dl
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    111f <ft_memset+0x1f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_memset>:
push   %rbx
mov    %rdi,%rbx
test   %rdx,%rdx
je     1121 <ft_memset+0x11>
mov    %rbx,%rdi
call   1030 <memset@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ft_memset(i8* returned writeonly %0, i32 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = trunc i32 %1 to i8
br label %7
7: ; preds = %5, %3
ret i8* %0
}
/* Variables and functions */
scalar_t__ sample_delta_r();
int sample_r(int nsteps) {
  int i, dist;
  dist = 0;
  for (i = 0; i < nsteps; i++)
    dist += sample_delta_r();
  return dist;
}


x86 assembly (clang, -O0):
<sample_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1157 <sample_r+0x47>
mov    $0x0,%al
call   1030 <sample_delta_r@plt>
mov    %rax,%rcx
movslq -0xc(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1129 <sample_r+0x19>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sample_r>:
push   %rbp
push   %rbx
push   %rax
test   %edi,%edi
jle    1130 <sample_r+0x20>
mov    %edi,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <sample_delta_r@plt>
add    %eax,%ebp
add    $0xffffffff,%ebx
jne    1120 <sample_r+0x10>
jmp    1132 <sample_r+0x22>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @sample_r(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %15, %1
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = call i64 (...) @sample_delta_r()
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = add nsw i64 %12, %10
%14 = trunc i64 %13 to i32
store i32 %14, i32* %4
br label %15
15: ; preds = %9
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %5
18: ; preds = %5
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @sample_r(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %11
3: ; preds = %1, %3
%4 = phi i32 [ %8, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = tail call i64 (...) @sample_delta_r()
%7 = trunc i64 %6 to i32
%8 = add i32 %4, %7
%9 = add nuw nsw i32 %5, 1
%10 = icmp eq i32 %9, %0
br i1 %10, label %11, label %3
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %12
}
/* Variables and functions */
int printf(char *, int, long, long);
int signed_long(void) {
  long a = 0x7E00FF0F;
  short b = 33;
  return printf("%lu, %ld, %ld\n", sizeof(a << b), a << b, a >> 4);
}


x86 assembly (clang, -O0):
<signed_long>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movq   $0x7e00ff0f,-0x8(%rbp)
7e
movw   $0x21,-0xa(%rbp)
mov    -0x8(%rbp),%rdx
movswl -0xa(%rbp),%eax
mov    %eax,%eax
mov    %eax,%ecx
shl    %cl,%rdx
mov    -0x8(%rbp),%rcx
sar    $0x4,%rcx
lea    0xebc(%rip),%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_long>:
lea    0xee9(%rip),%rdi
movabs $0xfc01fe1e00000000,%rdx
fe 01 fc
mov    $0x7e00ff0,%ecx
mov    $0x8,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"%lu, %ld, %ld\0A\00"
define i32 @signed_long() {
%1 = alloca i64
%2 = alloca i16
store i64 2113994511, i64* %1
store i16 33, i16* %2
%3 = load i64, i64* %1
%4 = load i16, i16* %2
%5 = sext i16 %4 to i32
%6 = zext i32 %5 to i64
%7 = shl i64 %3, %6
%8 = load i64, i64* %1
%9 = ashr i64 %8, 4
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 8, i64 %7, i64 %9)
ret i32 %10
}

LLVM IR (-O2):
@.str = [15 x i8] c"%lu, %ld, %ld\0A\00"
define i32 @signed_long() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 8, i64 -287669496372527104, i64 132124656)
ret i32 %1
}
struct SX *funcB() {
  extern struct SX X;
  struct SX *Xp = &X;
  return Xp;
}


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

x86 assembly (clang, -O2):
<funcB>:
mov    0x2ed9(%rip),%rax
ret

LLVM IR (-O0):
%struct.SX = type opaque
@X = external global %struct.SX
define %struct.SX* @funcB() {
%1 = alloca %struct.SX*
store %struct.SX* @X, %struct.SX** %1
%2 = load %struct.SX*, %struct.SX** %1
ret %struct.SX* %2
}

LLVM IR (-O2):
%struct.SX = type opaque
@X = external global %struct.SX
define %struct.SX* @funcB() {
ret %struct.SX* @X
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *strdup(char *);
char *measurement_sys_string(char *where) {
  char sys_string[1024];
  sprintf(sys_string, "select.sh '*' %s \"%s\" select", "measurement", where);
  return strdup(sys_string);
}


x86 assembly (clang, -O0):
<measurement_sys_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rcx
lea    0xebf(%rip),%rsi
lea    0xed5(%rip),%rdx
call   1030 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<measurement_sys_string>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rsi
lea    0xee4(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"select.sh '*' %s \22%s\22 select\00"
@.str.1 = [12 x i8] c"measurement\00"
define i8* @measurement_sys_string(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i8* @strdup(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [29 x i8] c"select.sh '*' %s \22%s\22 select\00"
@.str.1 = [12 x i8] c"measurement\00"
define noalias i8* @measurement_sys_string(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = call i8* @strdup(i8* %3)
ret i8* %5
}
void stk_play_wav(char *filename) { return; }


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

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

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

LLVM IR (-O2):
define void @stk_play_wav(i8* nocapture %0) {
ret void
}