xunge/DecIR huggingface dataset:
/* Type definitions */
struct sysrq_key_op {
  int dummy;
};

/* Variables and functions */
int EINVAL;
int register_sysrq_key(int key, struct sysrq_key_op *op) { return -EINVAL; }


x86 assembly (clang, -O0):
<register_sysrq_key>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    0x2ecc(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<register_sysrq_key>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.sysrq_key_op = type { i32 }
@EINVAL = global i32 0
define i32 @register_sysrq_key(i32 %0, %struct.sysrq_key_op* %1) {
%3 = alloca i32
%4 = alloca %struct.sysrq_key_op*
store i32 %0, i32* %3
store %struct.sysrq_key_op* %1, %struct.sysrq_key_op** %4
%5 = load i32, i32* @EINVAL
%6 = sub nsw i32 0, %5
ret i32 %6
}

LLVM IR (-O2):
%struct.sysrq_key_op = type { i32 }
@EINVAL = global i32 0
define i32 @register_sysrq_key(i32 %0, %struct.sysrq_key_op* nocapture readnone %1) {
%3 = load i32, i32* @EINVAL
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ free_string_list(char **);
void free_string_list_function(char ***ptr) {
  if (*ptr)
    free_string_list(*ptr);
}


x86 assembly (clang, -O0):
<free_string_list_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     1136 <free_string_list_function+0x26>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free_string_list@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_string_list_function>:
mov    (%rdi),%rdi
test   %rdi,%rdi
je     111d <free_string_list_function+0xd>
jmp    1030 <free_string_list@plt>
ret

LLVM IR (-O0):
define void @free_string_list_function(i8*** %0) {
%2 = alloca i8***
store i8*** %0, i8**** %2
%3 = load i8***, i8**** %2
%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**** %2
%8 = load i8**, i8*** %7
%9 = call i32 @free_string_list(i8** %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @free_string_list_function(i8*** nocapture %0) {
%2 = load i8**, i8*** %0
%3 = icmp eq i8** %2, null
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @free_string_list(i8** %2)
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello,world\n");
  return 0;
}


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"Hello,world\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
unsigned char authenticate(char *input) {
  char buffer[8];
  unsigned char authenticate = 0;
  strcpy(buffer, input);
  if (strcmp(buffer, "Password") == 0)
    authenticate = 1;
  return authenticate;
}


x86 assembly (clang, -O0):
<authenticate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x11(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    115b <authenticate+0x3b>
movb   $0x1,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<authenticate>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xec4(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
sete   %al
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"Password\00"
define zeroext i8 @authenticate(i8* %0) {
%2 = alloca [8 x i8]
%3 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%4 = call i32 @strcpy(i8* %3, i8* %0)
%5 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
%7 = zext i1 %6 to i8
ret i8 %7
}
/* Variables and functions */
int /*<<< orphan*/ basic();
int /*<<< orphan*/ deep_copy();
int main(void) {
  basic();
  deep_copy();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @basic()
%2 = tail call i32 (...) @deep_copy()
ret i32 0
}
/* Type definitions */
typedef unsigned int uint64_t;

/* Variables and functions */
uint64_t rotl64(uint64_t x, unsigned n) { return (x << n) | (x >> (64 - n)); }


x86 assembly (clang, -O0):
<rotl64>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x4(%rbp),%edx
mov    $0x40,%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rotl64>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
neg    %cl
shr    %cl,%edi
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @rotl64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 %5, %6
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = sub i32 64, %9
%11 = lshr i32 %8, %10
%12 = or i32 %7, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rotl64(i32 %0, i32 %1) {
%3 = shl i32 %0, %1
%4 = sub i32 64, %1
%5 = lshr i32 %0, %4
%6 = or i32 %5, %3
ret i32 %6
}
void r_fiq_handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<r_fiq_handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <r_fiq_handler+0x9>
jmp    1109 <r_fiq_handler+0x9>

x86 assembly (clang, -O2):
<r_fiq_handler>:
jmp    1100 <r_fiq_handler>

LLVM IR (-O0):
define void @r_fiq_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @r_fiq_handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int parseInt(char *, int);
char *stringToInt(int);
char *wum_mul(char *a, char *b) {
  return stringToInt((parseInt(a, 10) * parseInt(b, 10)));
}


x86 assembly (clang, -O0):
<wum_mul>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <parseInt@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0xa,%esi
call   1030 <parseInt@plt>
mov    -0x14(%rbp),%edi
imul   %eax,%edi
call   1040 <stringToInt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wum_mul>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    $0xa,%esi
call   1030 <parseInt@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <parseInt@plt>
imul   %eax,%ebp
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <stringToInt@plt>

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

LLVM IR (-O2):
define i8* @wum_mul(i8* %0, i8* %1) {
%3 = tail call i32 @parseInt(i8* %0, i32 10)
%4 = tail call i32 @parseInt(i8* %1, i32 10)
%5 = mul nsw i32 %4, %3
%6 = tail call i8* @stringToInt(i32 %5)
ret i8* %6
}
/* Variables and functions */
int rand();
unsigned short mk_rnd_u13() { return (rand() & 0x1fff); }


x86 assembly (clang, -O0):
<mk_rnd_u13>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
and    $0x1fff,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_rnd_u13>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
and    $0x1fff,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @mk_rnd_u13() {
%1 = call i32 (...) @rand()
%2 = and i32 %1, 8191
%3 = trunc i32 %2 to i16
ret i16 %3
}

LLVM IR (-O2):
define zeroext i16 @mk_rnd_u13() {
%1 = tail call i32 (...) @rand()
%2 = trunc i32 %1 to i16
%3 = and i16 %2, 8191
ret i16 %3
}
void caller_2_1_1_2_1_1_1() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_1_2_1_1_1() {
ret void
}
/* Type definitions */
struct sigaction {
  void (*sa_handler)(int);
};
typedef int /*<<< orphan*/ sa;

/* Variables and functions */
int /*<<< orphan*/ memset(struct sigaction *, int /*<<< orphan*/, int);
int /*<<< orphan*/ sigaction(int, struct sigaction *, int /*<<< orphan*/ *);
void catch_signal(int sig, void (*handler)(int)) {
  struct sigaction sa;
  memset(&sa, 0, sizeof(sa));
  sa.sa_handler = handler;
  sigaction(sig, &sa, NULL);
}


x86 assembly (clang, -O0):
<catch_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigaction@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<catch_signal>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0x8(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
mov    %rbx,0x8(%rsp)
mov    %ebp,%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <sigaction@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.sigaction = type { void (i32)* }
define void @catch_signal(i32 %0, void (i32)* %1) {
%3 = alloca i32
%4 = alloca void (i32)*
%5 = alloca %struct.sigaction
store i32 %0, i32* %3
store void (i32)* %1, void (i32)** %4
%6 = call i32 @memset(%struct.sigaction* %5, i32 0, i32 8)
%7 = load void (i32)*, void (i32)** %4
%8 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %5, i32 0, i32 0
store void (i32)* %7, void (i32)** %8
%9 = load i32, i32* %3
%10 = call i32 @sigaction(i32 %9, %struct.sigaction* %5, i32* null)
ret void
}

LLVM IR (-O2):
%struct.sigaction = type { void (i32)* }
define void @catch_signal(i32 %0, void (i32)* %1) {
%3 = alloca %struct.sigaction
%4 = bitcast %struct.sigaction* %3 to i8*
%5 = call i32 @memset(%struct.sigaction* %3, i32 0, i32 8)
%6 = getelementptr inbounds %struct.sigaction, %struct.sigaction* %3, i64 0, i32 0
store void (i32)* %1, void (i32)** %6
%7 = call i32 @sigaction(i32 %0, %struct.sigaction* %3, i32* null)
ret void
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ cleanup_test();
int /*<<< orphan*/ init_test();
int log_read_middle(int);
void read_one_page_middle(void) {
  ssize_t n;
  init_test();
  n = log_read_middle(4096);
  basic_test(n == 4096);
  cleanup_test();
}


x86 assembly (clang, -O0):
<read_one_page_middle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <init_test@plt>
mov    $0x1000,%edi
call   1040 <log_read_middle@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <basic_test@plt>
mov    $0x0,%al
call   1050 <cleanup_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_one_page_middle>:
push   %rax
xor    %eax,%eax
call   1060 <init_test@plt>
mov    $0x1000,%edi
call   1040 <log_read_middle@plt>
xor    %edi,%edi
cmp    $0x1000,%eax
sete   %dil
call   1030 <basic_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cleanup_test@plt>

LLVM IR (-O0):
define void @read_one_page_middle() {
%1 = alloca i32
%2 = call i32 (...) @init_test()
%3 = call i32 @log_read_middle(i32 4096)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 4096
%6 = zext i1 %5 to i32
%7 = call i32 @basic_test(i32 %6)
%8 = call i32 (...) @cleanup_test()
ret void
}

LLVM IR (-O2):
define void @read_one_page_middle() {
%1 = tail call i32 (...) @init_test()
%2 = tail call i32 @log_read_middle(i32 4096)
%3 = icmp eq i32 %2, 4096
%4 = zext i1 %3 to i32
%5 = tail call i32 @basic_test(i32 %4)
%6 = tail call i32 (...) @cleanup_test()
ret void
}
void ff_hevc_put_hevc_bi_w_epel_h24_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_w_epel_h24_8_sse4() {
ret void
}
void glutPushWindow(void) {}


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

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

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

LLVM IR (-O2):
define void @glutPushWindow() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, char *);
void print_message_function(void *ptr) {
  char *message;
  message = (char *)ptr;
  printf("%s ", message);
  fflush(NULL);
}


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

x86 assembly (clang, -O2):
<print_message_function>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <fflush@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define void @print_message_function(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @fflush(i32* null)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ NETSCAPE_SPKAC;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ NETSCAPE_SPKAC_it;
int i2d_NETSCAPE_SPKAC(NETSCAPE_SPKAC *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &NETSCAPE_SPKAC_it);
}


x86 assembly (clang, -O0):
<i2d_NETSCAPE_SPKAC>:
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    0x2eb1(%rip),%rdx
call   1030 <ASN1_item_i2d@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2d_NETSCAPE_SPKAC>:
mov    0x2ec9(%rip),%rdx
jmp    1030 <ASN1_item_i2d@plt>

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

LLVM IR (-O2):
@NETSCAPE_SPKAC_it = global i32 0
define i32 @i2d_NETSCAPE_SPKAC(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @NETSCAPE_SPKAC_it)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, int);
int /*<<< orphan*/ stderr;
char ExpectEqual(int a, int b) {
  if (a != b) {
    fprintf(stderr, "Expected %d == %d\n", a, b);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<ExpectEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     114e <ExpectEqual+0x3e>
mov    0x2eaf(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
movb   $0x0,-0x1(%rbp)
jmp    1152 <ExpectEqual+0x42>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ExpectEqual>:
mov    $0x1,%al
cmp    %esi,%edi
je     1136 <ExpectEqual+0x26>
push   %rax
mov    %esi,%ecx
mov    %edi,%edx
mov    0x2ebe(%rip),%rax
mov    (%rax),%edi
lea    0xed5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"Expected %d == %d\0A\00"
define signext i8 @ExpectEqual(i32 %0, i32 %1) {
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = icmp ne i32 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i32, i32* @stderr
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12)
store i8 0, i8* %3
br label %15
14: ; preds = %2
store i8 1, i8* %3
br label %15
15: ; preds = %14, %9
%16 = load i8, i8* %3
ret i8 %16
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"Expected %d == %d\0A\00"
define signext i8 @ExpectEqual(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, %1
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %7
7: ; preds = %2, %4
%8 = phi i8 [ 0, %4 ], [ 1, %2 ]
ret i8 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  printf("%d", a + b);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x4(%rbp),%esi
add    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %7, %6
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ put(int);
int rand();
int /*<<< orphan*/ take();
void *owner(void *arg) {
  int i;
  for (i = 0; i < 10; ++i) {
    if (rand() % 2) {
      take();
    } else {
      put(rand() % 2);
    }
  }
}


x86 assembly (clang, -O0):
<owner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    119a <owner+0x6a>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1171 <owner+0x41>
mov    $0x0,%al
call   1040 <take@plt>
jmp    1187 <owner+0x57>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
call   1030 <put@plt>
jmp    118c <owner+0x5c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1143 <owner+0x13>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<owner>:
push   %rbx
mov    $0xa,%ebx
jmp    115f <owner+0x2f>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <rand@plt>
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
mov    %eax,%edi
call   1030 <put@plt>
add    $0xffffffff,%ebx
je     1176 <owner+0x46>
xor    %eax,%eax
call   1050 <rand@plt>
test   $0x1,%al
je     1140 <owner+0x10>
xor    %eax,%eax
call   1040 <take@plt>
add    $0xffffffff,%ebx
jne    115f <owner+0x2f>
pop    %rbx
ret

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

LLVM IR (-O2):
define noalias i8* @owner(i8* nocapture readnone %0) {
br label %2
2: ; preds = %1, %13
%3 = phi i32 [ 0, %1 ], [ %14, %13 ]
%4 = tail call i32 (...) @rand()
%5 = and i32 %4, 1
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 (...) @take()
br label %13
9: ; preds = %2
%10 = tail call i32 (...) @rand()
%11 = srem i32 %10, 2
%12 = tail call i32 @put(i32 %11)
br label %13
13: ; preds = %7, %9
%14 = add nuw nsw i32 %3, 1
%15 = icmp eq i32 %14, 10
br i1 %15, label %16, label %2
16: ; preds = %13
ret i8* undef
}
/* Variables and functions */
int /*<<< orphan*/ gets(char *);
int main() {
  char buffer[32];
  gets(buffer);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
call   1030 <gets@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1030 <gets@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [32 x i8]
%2 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%3 = call i32 @gets(i8* %2)
ret i32 0
}
void asm_b_s(unsigned long *f, unsigned long i) {
  asm("btsq  %1, %0 \n" : : "m"(*f), "r"(i));
}


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

x86 assembly (clang, -O2):
<asm_b_s>:
bts    %rsi,(%rdi)
ret

LLVM IR (-O0):
define void @asm_b_s(i64* %0, i64 %1) {
%3 = alloca i64*
%4 = alloca i64
store i64* %0, i64** %3
store i64 %1, i64* %4
%5 = load i64*, i64** %3
%6 = load i64, i64* %4
ret void
}

LLVM IR (-O2):
define void @asm_b_s(i64* %0, i64 %1) {
tail call void asm sideeffect "btsq $1, $0 \0A", "*m,r,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %0, i64 %1)
ret void
}
/* Type definitions */
struct gost_mac_pmeth_data {
  int dummy;
};
typedef int /*<<< orphan*/ EVP_PKEY_CTX;

/* Variables and functions */
struct gost_mac_pmeth_data *EVP_PKEY_CTX_get_data(int /*<<< orphan*/ *);
int /*<<< orphan*/ OPENSSL_free(struct gost_mac_pmeth_data *);
void pkey_gost_mac_cleanup(EVP_PKEY_CTX *ctx) {
  struct gost_mac_pmeth_data *data = EVP_PKEY_CTX_get_data(ctx);
  OPENSSL_free(data);
}


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

x86 assembly (clang, -O2):
<pkey_gost_mac_cleanup>:
push   %rax
call   1030 <EVP_PKEY_CTX_get_data@plt>
mov    %rax,%rdi
pop    %rax
jmp    1040 <OPENSSL_free@plt>

LLVM IR (-O0):
%struct.gost_mac_pmeth_data = type { i32 }
define void @pkey_gost_mac_cleanup(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.gost_mac_pmeth_data*
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call %struct.gost_mac_pmeth_data* @EVP_PKEY_CTX_get_data(i32* %4)
store %struct.gost_mac_pmeth_data* %5, %struct.gost_mac_pmeth_data** %3
%6 = load %struct.gost_mac_pmeth_data*, %struct.gost_mac_pmeth_data** %3
%7 = call i32 @OPENSSL_free(%struct.gost_mac_pmeth_data* %6)
ret void
}

LLVM IR (-O2):
%struct.gost_mac_pmeth_data = type { i32 }
define void @pkey_gost_mac_cleanup(i32* %0) {
%2 = tail call %struct.gost_mac_pmeth_data* @EVP_PKEY_CTX_get_data(i32* %0)
%3 = tail call i32 @OPENSSL_free(%struct.gost_mac_pmeth_data* %2)
ret void
}
void ulog(p, a, s) struct h8_opcode *p;
char *a;
int s;
{ printf("dst = %s srcb ;\n", a); }


x86 assembly (clang, -O0):
<ulog>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ulog>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.h8_opcode = type opaque
@.str = [17 x i8] c"dst = %s srcb ;\0A\00"
define void @ulog(%struct.h8_opcode* %0, i8* %1, i32 %2) {
%4 = alloca %struct.h8_opcode*
%5 = alloca i8*
%6 = alloca i32
store %struct.h8_opcode* %0, %struct.h8_opcode** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %7)
ret void
}

LLVM IR (-O2):
%struct.h8_opcode = type opaque
@.str = [17 x i8] c"dst = %s srcb ;\0A\00"
define void @ulog(%struct.h8_opcode* nocapture readnone %0, i8* %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
double _pow(double, int);
double sqrt(double);
double hypot(double a, double b) {
  double c = 0;
  c = _pow(a, 2) + _pow(b, 2);
  return sqrt(c);
}


x86 assembly (clang, -O0):
<hypot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <_pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    $0x2,%edi
call   1030 <_pow@plt>
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1040 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hypot>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
mov    $0x2,%edi
call   1030 <_pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mov    $0x2,%edi
call   1030 <_pow@plt>
addsd  0x8(%rsp),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1163 <hypot+0x43>
sqrtsd %xmm0,%xmm0
add    $0x18,%rsp
ret
add    $0x18,%rsp
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @hypot(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
store double 0.000000e+00, double* %5
%6 = load double, double* %3
%7 = call double @_pow(double %6, i32 2)
%8 = load double, double* %4
%9 = call double @_pow(double %8, i32 2)
%10 = fadd double %7, %9
store double %10, double* %5
%11 = load double, double* %5
%12 = call double @sqrt(double %11)
ret double %12
}

LLVM IR (-O2):
define double @hypot(double %0, double %1) {
%3 = tail call double @_pow(double %0, i32 2)
%4 = tail call double @_pow(double %1, i32 2)
%5 = fadd double %3, %4
%6 = tail call double @sqrt(double %5)
ret double %6
}
unsigned int lt(unsigned int i, unsigned int j) {
  unsigned int ltb = ~j & i;
  unsigned int gtb = j & ~i;
  ltb |= ltb >> 1;
  ltb |= ltb >> 2;
  ltb |= ltb >> 4;
  ltb |= ltb >> 8;
  ltb |= ltb >> 16;
  return (gtb & ~ltb);
}


x86 assembly (clang, -O0):
<lt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
and    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x1,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x2,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x4,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lt>:
mov    %esi,%eax
not    %eax
and    %edi,%eax
mov    %eax,%ecx
shr    %ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x2,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,%eax
shr    $0x8,%eax
or     %ecx,%eax
mov    %eax,%ecx
shr    $0x10,%ecx
or     %edi,%eax
or     %ecx,%eax
not    %eax
and    %esi,%eax
ret

LLVM IR (-O0):
define i32 @lt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = xor i32 %7, -1
%9 = load i32, i32* %3
%10 = and i32 %8, %9
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = load i32, i32* %3
%13 = xor i32 %12, -1
%14 = and i32 %11, %13
store i32 %14, i32* %6
%15 = load i32, i32* %5
%16 = lshr i32 %15, 1
%17 = load i32, i32* %5
%18 = or i32 %17, %16
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = lshr i32 %19, 2
%21 = load i32, i32* %5
%22 = or i32 %21, %20
store i32 %22, i32* %5
%23 = load i32, i32* %5
%24 = lshr i32 %23, 4
%25 = load i32, i32* %5
%26 = or i32 %25, %24
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = lshr i32 %27, 8
%29 = load i32, i32* %5
%30 = or i32 %29, %28
store i32 %30, i32* %5
%31 = load i32, i32* %5
%32 = lshr i32 %31, 16
%33 = load i32, i32* %5
%34 = or i32 %33, %32
store i32 %34, i32* %5
%35 = load i32, i32* %6
%36 = load i32, i32* %5
%37 = xor i32 %36, -1
%38 = and i32 %35, %37
ret i32 %38
}

LLVM IR (-O2):
define i32 @lt(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = and i32 %3, %0
%5 = lshr i32 %4, 1
%6 = or i32 %5, %4
%7 = lshr i32 %6, 2
%8 = or i32 %7, %6
%9 = lshr i32 %8, 4
%10 = or i32 %9, %8
%11 = lshr i32 %10, 8
%12 = or i32 %11, %10
%13 = lshr i32 %12, 16
%14 = or i32 %12, %0
%15 = or i32 %14, %13
%16 = xor i32 %15, -1
%17 = and i32 %16, %1
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ writeInt(char *, int);
void start() {
  writeInt("senseL", 0);
  writeInt("senseR", 1);
  writeInt("pwmL", 255);
  writeInt("pwmR", 255);
}


x86 assembly (clang, -O0):
<start>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
call   1030 <writeInt@plt>
lea    0xede(%rip),%rdi
mov    $0x1,%esi
call   1030 <writeInt@plt>
lea    0xed4(%rip),%rdi
mov    $0xff,%esi
call   1030 <writeInt@plt>
lea    0xec8(%rip),%rdi
mov    $0xff,%esi
call   1030 <writeInt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<start>:
push   %rax
lea    0xee8(%rip),%rdi
xor    %esi,%esi
call   1030 <writeInt@plt>
lea    0xee1(%rip),%rdi
mov    $0x1,%esi
call   1030 <writeInt@plt>
lea    0xed7(%rip),%rdi
mov    $0xff,%esi
call   1030 <writeInt@plt>
lea    0xecb(%rip),%rdi
mov    $0xff,%esi
pop    %rax
jmp    1030 <writeInt@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"senseL\00"
@.str.1 = [7 x i8] c"senseR\00"
@.str.2 = [5 x i8] c"pwmL\00"
@.str.3 = [5 x i8] c"pwmR\00"
define void @start() {
%1 = call i32 @writeInt(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = call i32 @writeInt(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = call i32 @writeInt(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 255)
%4 = call i32 @writeInt(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 255)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"senseL\00"
@.str.1 = [7 x i8] c"senseR\00"
@.str.2 = [5 x i8] c"pwmL\00"
@.str.3 = [5 x i8] c"pwmR\00"
define void @start() {
%1 = tail call i32 @writeInt(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 0)
%2 = tail call i32 @writeInt(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @writeInt(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 255)
%4 = tail call i32 @writeInt(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 255)
ret void
}
int _isupper(int c) {
  if (c >= 'A' && c <= 'Z') {
    return (1);
  } else {
    return (0);
  }
}


x86 assembly (clang, -O0):
<_isupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     1127 <_isupper+0x27>
cmpl   $0x5a,-0x8(%rbp)
jg     1127 <_isupper+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <_isupper+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_isupper>:
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @_isupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 65
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 90
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @_isupper(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
int f1(int x) { return x; }


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

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

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

LLVM IR (-O2):
define i32 @f1(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int /*<<< orphan*/ putc(int);
void putchar(int c) { putc(c); }


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

x86 assembly (clang, -O2):
<putchar>:
jmp    1030 <putc@plt>

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

LLVM IR (-O2):
define void @putchar(i32 %0) {
%2 = tail call i32 @putc(i32 %0)
ret void
}
unsigned xrop3_250_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = D | T;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_250_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_250_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     $0xff,%ecx
and    %eax,%ecx
not    %eax
and    %esi,%eax
xor    $0xff,%esi
or     %ecx,%esi
or     %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_250_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, 255
%8 = and i32 %7, %4
%9 = xor i32 %5, 255
%10 = xor i32 %4, -1
%11 = and i32 %10, %5
%12 = or i32 %11, %9
%13 = or i32 %12, %8
ret i32 %13
}
/* Variables and functions */
int f();
int f1() { return f() + f() + f() + f(); }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <f@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <f@plt>
mov    %eax,%ebp
add    %ebx,%ebp
xor    %eax,%eax
call   1030 <f@plt>
mov    %eax,%ebx
add    %ebp,%ebx
xor    %eax,%eax
call   1030 <f@plt>
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @f1() {
%1 = call i32 (...) @f()
%2 = call i32 (...) @f()
%3 = add nsw i32 %1, %2
%4 = call i32 (...) @f()
%5 = add nsw i32 %3, %4
%6 = call i32 (...) @f()
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f1() {
%1 = tail call i32 (...) @f()
%2 = tail call i32 (...) @f()
%3 = add nsw i32 %2, %1
%4 = tail call i32 (...) @f()
%5 = add nsw i32 %3, %4
%6 = tail call i32 (...) @f()
%7 = add nsw i32 %5, %6
ret i32 %7
}
int rightmostW(char *array, int n) {
  for (int i = n - 1; i >= 0; i--) {
    if (array[i] == 'W') {
      return i;
    }
  }
  return -1;
}


x86 assembly (clang, -O0):
<rightmostW>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jl     1151 <rightmostW+0x51>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x57,%eax
jne    113e <rightmostW+0x3e>
mov    -0x18(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <rightmostW+0x58>
jmp    1143 <rightmostW+0x43>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    1114 <rightmostW+0x14>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightmostW>:
mov    %esi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %eax,%eax
jle    1121 <rightmostW+0x21>
add    $0xffffffffffffffff,%rax
mov    %eax,%ecx
cmpb   $0x57,(%rdi,%rcx,1)
jne    1110 <rightmostW+0x10>
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @rightmostW(i8* nocapture %0, i32 %1) {
%3 = zext i32 %1 to i64
br label %4
4: ; preds = %9, %2
%5 = phi i64 [ %6, %9 ], [ %3, %2 ]
%6 = add nsw i64 %5, -1
%7 = trunc i64 %5 to i32
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %4
%10 = and i64 %6, 4294967295
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 87
br i1 %13, label %14, label %4
14: ; preds = %9
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %4, %14
%17 = phi i32 [ %15, %14 ], [ -1, %4 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ wNotYet(char *);
scalar_t__ wPopNumber();
char *wPopString();
void wBasInsert() {
  char *source, *target;
  int index;
  index = (int)wPopNumber();
  target = wPopString();
  source = wPopString();
  wNotYet("Insert");
  free(source);
  free(target);
}


x86 assembly (clang, -O0):
<wBasInsert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <wPopNumber@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <wPopString@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <wPopString@plt>
mov    %rax,-0x8(%rbp)
lea    0xe91(%rip),%rdi
call   1060 <wNotYet@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasInsert>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <wPopNumber@plt>
xor    %eax,%eax
call   1040 <wPopString@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <wPopString@plt>
mov    %rax,%rbx
lea    0xe9a(%rip),%rdi
call   1060 <wNotYet@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"Insert\00"
define void @wBasInsert() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32
%4 = call i64 (...) @wPopNumber()
%5 = trunc i64 %4 to i32
store i32 %5, i32* %3
%6 = call i8* (...) @wPopString()
store i8* %6, i8** %2
%7 = call i8* (...) @wPopString()
store i8* %7, i8** %1
%8 = call i32 @wNotYet(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %1
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %2
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"Insert\00"
define void @wBasInsert() {
%1 = tail call i64 (...) @wPopNumber()
%2 = tail call i8* (...) @wPopString()
%3 = tail call i8* (...) @wPopString()
%4 = tail call i32 @wNotYet(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @free(i8* %3)
%6 = tail call i32 @free(i8* %2)
ret void
}
/* Type definitions */
struct timespec {
  int dummy;
};
struct io_event {
  int dummy;
};
typedef int /*<<< orphan*/ aio_context_t;

/* Variables and functions */
int /*<<< orphan*/ __NR_io_getevents;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, long, long,
            struct io_event *, struct timespec *);
int io_getevents(aio_context_t ctx, long min_nr, long max_nr,
                 struct io_event *events, struct timespec *timeout) {
  return syscall(__NR_io_getevents, ctx, min_nr, max_nr, events, timeout);
}


x86 assembly (clang, -O0):
<io_getevents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1030 <syscall@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_getevents>:
mov    %r8,%r9
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ebb(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.io_event = type { i32 }
%struct.timespec = type { i32 }
@__NR_io_getevents = global i32 0
define i32 @io_getevents(i32 %0, i64 %1, i64 %2, %struct.io_event* %3, %struct.timespec* %4) {
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca %struct.io_event*
%10 = alloca %struct.timespec*
store i32 %0, i32* %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store %struct.io_event* %3, %struct.io_event** %9
store %struct.timespec* %4, %struct.timespec** %10
%11 = load i32, i32* @__NR_io_getevents
%12 = load i32, i32* %6
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = load %struct.io_event*, %struct.io_event** %9
%16 = load %struct.timespec*, %struct.timespec** %10
%17 = call i32 @syscall(i32 %11, i32 %12, i64 %13, i64 %14, %struct.io_event* %15, %struct.timespec* %16)
ret i32 %17
}

LLVM IR (-O2):
%struct.io_event = type { i32 }
%struct.timespec = type { i32 }
@__NR_io_getevents = global i32 0
define i32 @io_getevents(i32 %0, i64 %1, i64 %2, %struct.io_event* %3, %struct.timespec* %4) {
%6 = load i32, i32* @__NR_io_getevents
%7 = tail call i32 @syscall(i32 %6, i32 %0, i64 %1, i64 %2, %struct.io_event* %3, %struct.timespec* %4)
ret i32 %7
}