xunge/DecIR huggingface dataset:
void breakup(unsigned long long int x, unsigned short xv[4]) {
  xv[0] = x & 0xffff;
  xv[1] = (x >> 16) & 0xffff;
  xv[2] = (x >> 32) & 0xffff;
  xv[3] = (x >> 48) & 0xffff;
}


x86 assembly (clang, -O0):
<breakup>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
and    $0xffff,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
and    $0xffff,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x2(%rax)
mov    -0x8(%rbp),%rax
shr    $0x20,%rax
and    $0xffff,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x4(%rax)
mov    -0x8(%rbp),%rax
shr    $0x30,%rax
and    $0xffff,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,0x6(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @breakup(i64 %0, i16* %1) {
%3 = alloca i64
%4 = alloca i16*
store i64 %0, i64* %3
store i16* %1, i16** %4
%5 = load i64, i64* %3
%6 = and i64 %5, 65535
%7 = trunc i64 %6 to i16
%8 = load i16*, i16** %4
%9 = getelementptr inbounds i16, i16* %8, i64 0
store i16 %7, i16* %9
%10 = load i64, i64* %3
%11 = lshr i64 %10, 16
%12 = and i64 %11, 65535
%13 = trunc i64 %12 to i16
%14 = load i16*, i16** %4
%15 = getelementptr inbounds i16, i16* %14, i64 1
store i16 %13, i16* %15
%16 = load i64, i64* %3
%17 = lshr i64 %16, 32
%18 = and i64 %17, 65535
%19 = trunc i64 %18 to i16
%20 = load i16*, i16** %4
%21 = getelementptr inbounds i16, i16* %20, i64 2
store i16 %19, i16* %21
%22 = load i64, i64* %3
%23 = lshr i64 %22, 48
%24 = and i64 %23, 65535
%25 = trunc i64 %24 to i16
%26 = load i16*, i16** %4
%27 = getelementptr inbounds i16, i16* %26, i64 3
store i16 %25, i16* %27
ret void
}

LLVM IR (-O2):
define void @breakup(i64 %0, i16* nocapture writeonly %1) {
%3 = trunc i64 %0 to i16
store i16 %3, i16* %1
%4 = lshr i64 %0, 16
%5 = trunc i64 %4 to i16
%6 = getelementptr inbounds i16, i16* %1, i64 1
store i16 %5, i16* %6
%7 = lshr i64 %0, 32
%8 = trunc i64 %7 to i16
%9 = getelementptr inbounds i16, i16* %1, i64 2
store i16 %8, i16* %9
%10 = lshr i64 %0, 48
%11 = trunc i64 %10 to i16
%12 = getelementptr inbounds i16, i16* %1, i64 3
store i16 %11, i16* %12
ret void
}
/* Type definitions */
struct state {
  int dummy;
};
struct debug_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void cli_ambiguous(struct state *context, struct debug_state *dbg_state,
                   char **args) {
  printf("ambiguous instruction: %s\n", args[0]);
}


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

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

LLVM IR (-O0):
%struct.state = type { i32 }
%struct.debug_state = type { i32 }
@.str = [27 x i8] c"ambiguous instruction: %s\0A\00"
define void @cli_ambiguous(%struct.state* %0, %struct.debug_state* %1, i8** %2) {
%4 = alloca %struct.state*
%5 = alloca %struct.debug_state*
%6 = alloca i8**
store %struct.state* %0, %struct.state** %4
store %struct.debug_state* %1, %struct.debug_state** %5
store i8** %2, i8*** %6
%7 = load i8**, i8*** %6
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %9)
ret void
}

LLVM IR (-O2):
%struct.state = type { i32 }
%struct.debug_state = type { i32 }
@.str = [27 x i8] c"ambiguous instruction: %s\0A\00"
define void @cli_ambiguous(%struct.state* nocapture readnone %0, %struct.debug_state* nocapture readnone %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}
/* Variables and functions */
bool get_true(void) { return (true); }


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

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

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

LLVM IR (-O2):
define i32 @get_true() {
ret i32 1
}
/* Variables and functions */
char *multi(char *, char *);
int /*<<< orphan*/ printf(char *, char *);
int main() {
  char number_a[] = "0009";
  char number_b[] = "9999";
  printf("%s\n", multi(number_a, number_b));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x9(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xebe(%rip),%eax
mov    %eax,-0xe(%rbp)
mov    0xeb9(%rip),%al
mov    %al,-0xa(%rbp)
lea    -0x9(%rbp),%rdi
lea    -0xe(%rbp),%rsi
call   1040 <multi@plt>
mov    %rax,%rsi
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movb   $0x0,0x14(%rsp)
movl   $0x39303030,0x10(%rsp)
39
movb   $0x0,0xc(%rsp)
movl   $0x39393939,0x8(%rsp)
39
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1040 <multi@plt>
lea    0xeb6(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@__const.main.number_a = [5 x i8] c"0009\00"
@__const.main.number_b = [5 x i8] c"9999\00"
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i8* @multi(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
unsigned short wimaxll_swap_16(unsigned short);
unsigned short wimaxll_cpu_to_be16(unsigned short x) {
  unsigned short be16;
  be16 = wimaxll_swap_16(x);
  return be16;
}


x86 assembly (clang, -O0):
<wimaxll_cpu_to_be16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <wimaxll_swap_16@plt>
mov    %ax,-0x4(%rbp)
movzwl -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wimaxll_cpu_to_be16>:
jmp    1030 <wimaxll_swap_16@plt>

LLVM IR (-O0):
define zeroext i16 @wimaxll_cpu_to_be16(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call zeroext i16 @wimaxll_swap_16(i16 zeroext %4)
store i16 %5, i16* %3
%6 = load i16, i16* %3
ret i16 %6
}

LLVM IR (-O2):
define zeroext i16 @wimaxll_cpu_to_be16(i16 zeroext %0) {
%2 = tail call zeroext i16 @wimaxll_swap_16(i16 zeroext %0)
ret i16 %2
}
int until(char seq[], int (*comp)(char), int start) {
  while (comp(seq[start]))
    start++;
  return start;
}


x86 assembly (clang, -O0):
<until>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0x14(%rbp),%rdx
movsbl (%rcx,%rdx,1),%edi
call   *%rax
cmp    $0x0,%eax
je     113c <until+0x3c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1113 <until+0x13>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<until>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
movslq %edx,%rax
lea    -0x1(%rax),%ebp
add    %rax,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl (%rbx),%edi
call   *%r14
add    $0x1,%ebp
add    $0x1,%rbx
test   %eax,%eax
jne    1120 <until+0x20>
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @until(i8* nocapture %0, i32 (i8)* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
br label %5
5: ; preds = %5, %3
%6 = phi i64 [ %11, %5 ], [ %4, %3 ]
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = load i8, i8* %7
%9 = tail call i32 %1(i8 signext %8)
%10 = icmp eq i32 %9, 0
%11 = add i64 %6, 1
br i1 %10, label %12, label %5
12: ; preds = %5
%13 = trunc i64 %6 to i32
ret i32 %13
}
void strcat_ptr(char *s, char *t) {
  char *p = s, *q = t;
  for (; *p; p++)
    ;
  while ((*p++ = *q++))
    ;
}


x86 assembly (clang, -O0):
<strcat_ptr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     113f <strcat_ptr+0x3f>
jmp    112e <strcat_ptr+0x2e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    111c <strcat_ptr+0x1c>
jmp    1144 <strcat_ptr+0x44>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%al
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1173 <strcat_ptr+0x73>
jmp    1144 <strcat_ptr+0x44>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcat_ptr>:
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1100 <strcat_ptr>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movzbl (%rsi,%rax,1),%ecx
mov    %cl,-0x1(%rdi,%rax,1)
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strcat_ptr+0x10>
ret

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

LLVM IR (-O2):
define void @strcat_ptr(i8* nocapture %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3, %8
%9 = phi i8* [ %13, %8 ], [ %4, %3 ]
%10 = phi i8* [ %11, %8 ], [ %1, %3 ]
%11 = getelementptr inbounds i8, i8* %10, i64 1
%12 = load i8, i8* %10
%13 = getelementptr inbounds i8, i8* %9, i64 1
store i8 %12, i8* %9
%14 = icmp eq i8 %12, 0
br i1 %14, label %15, label %8
15: ; preds = %8
ret void
}
void bkl_unlock(void) {}


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

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

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

LLVM IR (-O2):
define void @bkl_unlock() {
ret void
}
/* Variables and functions */
double drand48();
double gmatrix_drand() { return drand48(); }


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

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

LLVM IR (-O0):
define double @gmatrix_drand() {
%1 = call double (...) @drand48()
ret double %1
}

LLVM IR (-O2):
define double @gmatrix_drand() {
%1 = tail call double (...) @drand48()
ret double %1
}
/* Variables and functions */
int /*<<< orphan*/ is_a_valid_move(char);
int rand();
int random_strategy(char board[], char player) {
  int move = rand() % 9;
  while (!(is_a_valid_move(board[move]))) {
    move = rand() % 9;
  }
  return move;
}


x86 assembly (clang, -O0):
<random_strategy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <is_a_valid_move@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    116a <random_strategy+0x4a>
jmp    1181 <random_strategy+0x61>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0x9,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
jmp    1144 <random_strategy+0x24>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_strategy>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rbx
imul   $0x38e38e39,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rax
add    %ecx,%eax
lea    (%rax,%rax,8),%eax
sub    %eax,%ebx
movslq %ebx,%rax
movsbl (%r14,%rax,1),%edi
call   1030 <is_a_valid_move@plt>
test   %eax,%eax
je     1130 <random_strategy+0x10>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @random_strategy(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = call i32 (...) @rand()
%7 = srem i32 %6, 9
store i32 %7, i32* %5
br label %8
8: ; preds = %17, %2
%9 = load i8*, i8** %3
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = call i32 @is_a_valid_move(i8 signext %13)
%15 = icmp ne i32 %14, 0
%16 = xor i1 %15, true
br i1 %16, label %17, label %20
17: ; preds = %8
%18 = call i32 (...) @rand()
%19 = srem i32 %18, 9
store i32 %19, i32* %5
br label %8
20: ; preds = %8
%21 = load i32, i32* %5
ret i32 %21
}

LLVM IR (-O2):
define i32 @random_strategy(i8* nocapture %0, i8 signext %1) {
%3 = tail call i32 (...) @rand()
%4 = srem i32 %3, 9
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @is_a_valid_move(i8 signext %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %2, %10
%11 = tail call i32 (...) @rand()
%12 = srem i32 %11, 9
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = tail call i32 @is_a_valid_move(i8 signext %15)
%17 = icmp eq i32 %16, 0
br i1 %17, label %10, label %18
18: ; preds = %10, %2
%19 = phi i32 [ %4, %2 ], [ %12, %10 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ puts(char const *);
void mputs(const char *s) { puts(s); }


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

x86 assembly (clang, -O2):
<mputs>:
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
define void @mputs(i8* nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct ts_tdt {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ts_tdt_alloc();
struct ts_tdt *ts_tdt_init_empty(int /*<<< orphan*/, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
struct ts_tdt *ts_tdt_alloc_init(time_t ts) {
  return ts_tdt_init_empty(ts_tdt_alloc(), ts, 0);
}


x86 assembly (clang, -O0):
<ts_tdt_alloc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <ts_tdt_alloc@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
xor    %edx,%edx
call   1040 <ts_tdt_init_empty@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_tdt_alloc_init>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <ts_tdt_alloc@plt>
mov    %eax,%edi
mov    %ebx,%esi
xor    %edx,%edx
pop    %rbx
jmp    1040 <ts_tdt_init_empty@plt>

LLVM IR (-O0):
%struct.ts_tdt = type { i32 }
define %struct.ts_tdt* @ts_tdt_alloc_init(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @ts_tdt_alloc()
%4 = load i32, i32* %2
%5 = call %struct.ts_tdt* @ts_tdt_init_empty(i32 %3, i32 %4, i32 0)
ret %struct.ts_tdt* %5
}

LLVM IR (-O2):
%struct.ts_tdt = type { i32 }
define %struct.ts_tdt* @ts_tdt_alloc_init(i32 %0) {
%2 = tail call i32 (...) @ts_tdt_alloc()
%3 = tail call %struct.ts_tdt* @ts_tdt_init_empty(i32 %2, i32 %0, i32 0)
ret %struct.ts_tdt* %3
}
char *get_statement(int num, char *a) { return a + (num * 10); }


x86 assembly (clang, -O0):
<get_statement>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   $0xa,-0x4(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_statement>:
add    %edi,%edi
lea    (%rdi,%rdi,4),%eax
cltq
add    %rsi,%rax
ret

LLVM IR (-O0):
define i8* @get_statement(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = load i32, i32* %3
%7 = mul nsw i32 %6, 10
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
ret i8* %9
}

LLVM IR (-O2):
define i8* @get_statement(i32 %0, i8* readnone %1) {
%3 = mul nsw i32 %0, 10
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %1, i64 %4
ret i8* %5
}
/* Variables and functions */
size_t get_data_tag_in_TrdgSesGrp(size_t __tag) {
  (void)__tag;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @get_data_tag_in_TrdgSesGrp(i64 %0) {
ret i64 0
}
/* Variables and functions */
int getpid();
int getTaskId() { return getpid(); }


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

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

LLVM IR (-O0):
define i32 @getTaskId() {
%1 = call i32 (...) @getpid()
ret i32 %1
}

LLVM IR (-O2):
define i32 @getTaskId() {
%1 = tail call i32 (...) @getpid()
ret i32 %1
}
/* Variables and functions */
char const *resolver_name_from_id(int, int, int);
const char *resolver_name_from_node_id(int nodeId) {
  return resolver_name_from_id(nodeId, -1, -1);
}


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

x86 assembly (clang, -O2):
<resolver_name_from_node_id>:
mov    $0xffffffff,%esi
mov    $0xffffffff,%edx
jmp    1030 <resolver_name_from_id@plt>

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

LLVM IR (-O2):
define i8* @resolver_name_from_node_id(i32 %0) {
%2 = tail call i8* @resolver_name_from_id(i32 %0, i32 -1, i32 -1)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SFD_NONBLOCK;
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
scalar_t__ signalfd(int, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(void) {
  sigset_t foo;
  sigemptyset(&foo);
  if (signalfd(-1, &foo, SFD_NONBLOCK) < 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
lea    -0x8(%rbp),%rsi
call   1030 <signalfd@plt>
cmp    $0x0,%rax
jge    1165 <main+0x45>
movl   $0x1,-0x4(%rbp)
jmp    116c <main+0x4c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigemptyset@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
mov    $0xffffffff,%edi
mov    %rbx,%rsi
call   1030 <signalfd@plt>
shr    $0x3f,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SFD_NONBLOCK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @sigemptyset(i32* %2)
%4 = load i32, i32* @SFD_NONBLOCK
%5 = call i64 @signalfd(i32 -1, i32* %2, i32 %4)
%6 = icmp slt i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 1, i32* %1
br label %9
8: ; preds = %0
store i32 0, i32* %1
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %1
ret i32 %10
}

LLVM IR (-O2):
@SFD_NONBLOCK = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigemptyset(i32* %1)
%4 = load i32, i32* @SFD_NONBLOCK
%5 = call i64 @signalfd(i32 -1, i32* %1, i32 %4)
%6 = lshr i64 %5, 63
%7 = trunc i64 %6 to i32
ret i32 %7
}
int ras_userspace_consumers(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @ras_userspace_consumers() {
ret i32 0
}
/* Variables and functions */
size_t strlen(const char *str) {
  int i = 0;
  while (str[i] != '\0') {
    i++;
  }
  return i;
}


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

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

LLVM IR (-O0):
define i64 @strlen(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %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 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %4
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
ret i64 %17
}

LLVM IR (-O2):
define i64 @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 = and i64 %3, 4294967295
ret i64 %9
}
int test_imm_A7int16_mem(short *val) {
  return ((*val) & (0xA7 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A7int16_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, 167
%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_A7int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 167
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ serial_available();
int /*<<< orphan*/ serial_flush();
unsigned char serial_read();
unsigned char serial_getkey() {
  unsigned char c;
  while (!(serial_available()))
    ;
  c = serial_read();
  serial_flush();
  return (c);
}


x86 assembly (clang, -O0):
<serial_getkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <serial_available@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1154 <serial_getkey+0x24>
jmp    1159 <serial_getkey+0x29>
jmp    1138 <serial_getkey+0x8>
mov    $0x0,%al
call   1050 <serial_read@plt>
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1040 <serial_flush@plt>
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_getkey>:
push   %rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <serial_available@plt>
test   %eax,%eax
je     1140 <serial_getkey+0x10>
xor    %eax,%eax
call   1050 <serial_read@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <serial_flush@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define zeroext i8 @serial_getkey() {
%1 = alloca i8
br label %2
2: ; preds = %6, %0
%3 = call i32 (...) @serial_available()
%4 = icmp ne i32 %3, 0
%5 = xor i1 %4, true
br i1 %5, label %6, label %7
6: ; preds = %2
br label %2
7: ; preds = %2
%8 = call zeroext i8 (...) @serial_read()
store i8 %8, i8* %1
%9 = call i32 (...) @serial_flush()
%10 = load i8, i8* %1
ret i8 %10
}

LLVM IR (-O2):
define zeroext i8 @serial_getkey() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @serial_available()
%3 = icmp eq i32 %2, 0
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call zeroext i8 (...) @serial_read()
%6 = tail call i32 (...) @serial_flush()
ret i8 %5
}
/* Variables and functions */
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1000];
  while ((len = getline(line, 1000)) > 0)
    if (len > 80)
      printf("%s", line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x50,-0x8(%rbp)
jle    116c <main+0x4c>
lea    -0x3f0(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x51,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getline(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %15
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 80
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %14
14: ; preds = %11, %8
br label %4
15: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 80
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getline(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
int is_leap_year(int year) {
  return ((year % 4 == 0) && (!(year % 100 == 0) || (year % 400 == 0)));
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <is_leap_year+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <is_leap_year+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <is_leap_year+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <is_leap_year+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @is_leap_year(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Variables and functions */
int f199(int *);
int f200(int *p) { return f199(p); }


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

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

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

LLVM IR (-O2):
define i32 @f200(i32* %0) {
%2 = tail call i32 @f199(i32* %0)
ret i32 %2
}
/* Variables and functions */
int atoi(char const *);
int soru_3(const char *s1, const char *s2) {
  int sum, a, b;
  sum = atoi(s1) + atoi(s2);
  return sum;
}


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

x86 assembly (clang, -O2):
<soru_3>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <atoi@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <atoi@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @soru_3(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @atoi(i8* %8)
%10 = load i8*, i8** %4
%11 = call i32 @atoi(i8* %10)
%12 = add nsw i32 %9, %11
store i32 %12, i32* %5
%13 = load i32, i32* %5
ret i32 %13
}

LLVM IR (-O2):
define i32 @soru_3(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @atoi(i8* %0)
%4 = tail call i32 @atoi(i8* %1)
%5 = add nsw i32 %4, %3
ret i32 %5
}
void serial_putc(int ch) {
  unsigned long temp;
  for (temp = 0; temp < 1000; temp++) {
  }
  *(char *)0xbd000020 = (char)ch;
}


x86 assembly (clang, -O0):
<serial_putc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x3e8,-0x10(%rbp)
jae    1133 <serial_putc+0x33>
jmp    1122 <serial_putc+0x22>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110f <serial_putc+0xf>
mov    -0x4(%rbp),%eax
mov    %al,%cl
mov    $0xbd000020,%eax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_putc>:
mov    $0xbd000020,%eax
mov    %dil,(%rax)
ret

LLVM IR (-O0):
define void @serial_putc(i32 %0) {
%2 = alloca i32
%3 = alloca i64
store i32 %0, i32* %2
store i64 0, i64* %3
br label %4
4: ; preds = %8, %1
%5 = load i64, i64* %3
%6 = icmp ult i64 %5, 1000
br i1 %6, label %7, label %11
7: ; preds = %4
br label %8
8: ; preds = %7
%9 = load i64, i64* %3
%10 = add i64 %9, 1
store i64 %10, i64* %3
br label %4
11: ; preds = %4
%12 = load i32, i32* %2
%13 = trunc i32 %12 to i8
store i8 %13, i8* inttoptr (i64 3170893856 to i8*)
ret void
}

LLVM IR (-O2):
define void @serial_putc(i32 %0) {
%2 = trunc i32 %0 to i8
store i8 %2, i8* inttoptr (i64 3170893856 to i8*)
ret void
}
/* Type definitions */
typedef int key_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int ftok(char *, int);
int /*<<< orphan*/ perror(char *);
key_t getkey(int id) {
  key_t clave;
  clave = ftok(".", id);
  if (clave == -1) {
    perror("La clave ingresado es erronea");
    exit(-1);
  }
  return clave;
}


x86 assembly (clang, -O0):
<getkey>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xebb(%rip),%rdi
call   1050 <ftok@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    116d <getkey+0x3d>
lea    0xea4(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getkey>:
push   %rax
mov    %edi,%esi
lea    0xec6(%rip),%rdi
call   1050 <ftok@plt>
cmp    $0xffffffff,%eax
je     1146 <getkey+0x16>
pop    %rcx
ret
lea    0xeb5(%rip),%rdi
call   1030 <perror@plt>
mov    $0xffffffff,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [30 x i8] c"La clave ingresado es erronea\00"
define i32 @getkey(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @ftok(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
%12 = load i32, i32* %3
ret i32 %12
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [30 x i8] c"La clave ingresado es erronea\00"
define i32 @getkey(i32 %0) {
%2 = tail call i32 @ftok(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @exit(i32 -1)
unreachable
7: ; preds = %1
ret i32 %2
}
void MM_Frame(const int realmsec) {}


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

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

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

LLVM IR (-O2):
define void @MM_Frame(i32 %0) {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ core;
};
typedef TYPE_1__ XkbEvent;
typedef int /*<<< orphan*/ Display;

/* Variables and functions */
int /*<<< orphan*/ XNextEvent(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
void wait_gr_event(Display *dpy) {
  XkbEvent ev;
  XNextEvent(dpy, &ev.core);
}


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

x86 assembly (clang, -O2):
<wait_gr_event>:
push   %rax
mov    %rsp,%rsi
call   1030 <XNextEvent@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
define void @wait_gr_event(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.TYPE_2__
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %3, i32 0, i32 0
%6 = call i32 @XNextEvent(i32* %4, i32* %5)
ret void
}

LLVM IR (-O2):
%struct.TYPE_2__ = type { i32 }
define void @wait_gr_event(i32* %0) {
%2 = alloca %struct.TYPE_2__
%3 = bitcast %struct.TYPE_2__* %2 to i8*
%4 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %2, i64 0, i32 0
%5 = call i32 @XNextEvent(i32* %0, i32* %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Car_Get(int);
int Car_GetSpeed(int /*<<< orphan*/);
int Car_GetCarSpeed(int carnum) { return Car_GetSpeed(Car_Get(carnum)); }


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

x86 assembly (clang, -O2):
<Car_GetCarSpeed>:
push   %rax
call   1030 <Car_Get@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <Car_GetSpeed@plt>

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

LLVM IR (-O2):
define i32 @Car_GetCarSpeed(i32 %0) {
%2 = tail call i32 @Car_Get(i32 %0)
%3 = tail call i32 @Car_GetSpeed(i32 %2)
ret i32 %3
}
/* Variables and functions */
scalar_t__ SD_Init();
char STORAGE_Init(void) {
  (*(volatile unsigned char *)(((0xE0000000 + 0xE000) + 0x0100) + 0x300 + 49)) =
      0;
  (*(volatile unsigned int *)(((0xE0000000 + 0xE000) + 0x0100) + 0x00 +
                              (49 / 32 * 4))) |= (1 << (49 % 32));
  if (SD_Init() != 0) {
    return (-1);
  }
  return (0);
}


x86 assembly (clang, -O0):
<STORAGE_Init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xe000e431,%eax
movb   $0x0,(%rax)
mov    $0xe000e104,%eax
mov    (%rax),%ecx
or     $0x20000,%ecx
mov    $0xe000e104,%eax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <SD_Init@plt>
cmp    $0x0,%rax
je     114e <STORAGE_Init+0x3e>
movb   $0xff,-0x1(%rbp)
jmp    1152 <STORAGE_Init+0x42>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<STORAGE_Init>:
push   %rax
mov    $0xe000e104,%eax
movb   $0x0,0x32d(%rax)
orl    $0x20000,(%rax)
xor    %eax,%eax
call   1030 <SD_Init@plt>
neg    %rax
sbb    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @STORAGE_Init() {
%1 = alloca i8
store volatile i8 0, i8* inttoptr (i64 3758154801 to i8*)
%2 = load volatile i32, i32* inttoptr (i64 3758153988 to i32*)
%3 = or i32 %2, 131072
store volatile i32 %3, i32* inttoptr (i64 3758153988 to i32*)
%4 = call i64 (...) @SD_Init()
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i8 -1, i8* %1
br label %8
7: ; preds = %0
store i8 0, i8* %1
br label %8
8: ; preds = %7, %6
%9 = load i8, i8* %1
ret i8 %9
}

LLVM IR (-O2):
define signext i8 @STORAGE_Init() {
store volatile i8 0, i8* inttoptr (i64 3758154801 to i8*)
%1 = load volatile i32, i32* inttoptr (i64 3758153988 to i32*)
%2 = or i32 %1, 131072
store volatile i32 %2, i32* inttoptr (i64 3758153988 to i32*)
%3 = tail call i64 (...) @SD_Init()
%4 = icmp ne i64 %3, 0
%5 = sext i1 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ nsc_assert(int);
void pgsignal(void) {
  nsc_assert(0 && "This function is unimplemented.");
  ;
}


x86 assembly (clang, -O0):
<pgsignal>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <nsc_assert@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @pgsignal() {
%1 = call i32 @nsc_assert(i32 0)
ret void
}

LLVM IR (-O2):
define void @pgsignal() {
%1 = tail call i32 @nsc_assert(i32 0)
ret void
}
int test_imm_C4int32_reg(int val) { return ((val) & (0xC4 << 0)) ? -20 : -40; }


x86 assembly (clang, -O0):
<test_imm_C4int32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0xc4,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C4int32_reg>:
test   $0xc4,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_C4int32_reg(i32 %0) {
%2 = and i32 %0, 196
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
scalar_t__ floatToRawIntBits(double);
__attribute__((always_)) const int xisnegzerof(float x) {
  return floatToRawIntBits(x) == floatToRawIntBits(-0.0);
}


x86 assembly (clang, -O0):
<xisnegzerof>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
call   1030 <floatToRawIntBits@plt>
mov    %rax,-0x10(%rbp)
movsd  0xec9(%rip),%xmm0
call   1030 <floatToRawIntBits@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xisnegzerof>:
push   %rbx
cvtss2sd %xmm0,%xmm0
call   1030 <floatToRawIntBits@plt>
mov    %rax,%rbx
movsd  0xedb(%rip),%xmm0
call   1030 <floatToRawIntBits@plt>
xor    %ecx,%ecx
cmp    %rax,%rbx
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @xisnegzerof(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i64 @floatToRawIntBits(double %4)
%6 = call i64 @floatToRawIntBits(double -0.000000e+00)
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @xisnegzerof(float %0) {
%2 = fpext float %0 to double
%3 = tail call i64 @floatToRawIntBits(double %2)
%4 = tail call i64 @floatToRawIntBits(double -0.000000e+00)
%5 = icmp eq i64 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
scalar_t__ chdir(char *);
int smm_errno_update(int);
int smm_chdir(char *path) {
  if (path == NULL) {
    return smm_errno_update(0);
  }
  if (chdir(path) < 0) {
    return smm_errno_update((0xC0000000 | (4)));
  }
  return smm_errno_update(0);
}


x86 assembly (clang, -O0):
<smm_chdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <smm_chdir+0x26>
xor    %edi,%edi
call   1040 <smm_errno_update@plt>
mov    %eax,-0x4(%rbp)
jmp    1175 <smm_chdir+0x55>
mov    -0x10(%rbp),%rdi
call   1030 <chdir@plt>
cmp    $0x0,%rax
jge    116b <smm_chdir+0x4b>
mov    $0xc0000004,%edi
call   1040 <smm_errno_update@plt>
mov    %eax,-0x4(%rbp)
jmp    1175 <smm_chdir+0x55>
xor    %edi,%edi
call   1040 <smm_errno_update@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smm_chdir>:
test   %rdi,%rdi
je     1141 <smm_chdir+0x21>
push   %rax
call   1030 <chdir@plt>
mov    %rax,%rdi
sar    $0x3f,%rdi
and    $0xc0000004,%edi
add    $0x8,%rsp
jmp    1040 <smm_errno_update@plt>
xor    %edi,%edi
jmp    1040 <smm_errno_update@plt>

LLVM IR (-O0):
define i32 @smm_chdir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @smm_errno_update(i32 0)
store i32 %7, i32* %2
br label %16
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @chdir(i8* %9)
%11 = icmp slt i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %8
%13 = call i32 @smm_errno_update(i32 -1073741820)
store i32 %13, i32* %2
br label %16
14: ; preds = %8
%15 = call i32 @smm_errno_update(i32 0)
store i32 %15, i32* %2
br label %16
16: ; preds = %14, %12, %6
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
define i32 @smm_chdir(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = tail call i64 @chdir(i8* %0)
%5 = icmp slt i64 %4, 0
%6 = select i1 %5, i32 -1073741820, i32 0
br label %7
7: ; preds = %3, %1
%8 = phi i32 [ 0, %1 ], [ %6, %3 ]
%9 = tail call i32 @smm_errno_update(i32 %8)
ret i32 %9
}
int fun869() { return 869; }


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

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

LLVM IR (-O0):
define i32 @fun869() {
ret i32 869
}

LLVM IR (-O2):
define i32 @fun869() {
ret i32 869
}