xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
int /*<<< orphan*/ VibrationAnalysisOutputHandle();
void VibrationAnalysisOutputUpdated() {
  UAVObjUpdated(VibrationAnalysisOutputHandle());
}


x86 assembly (clang, -O0):
<VibrationAnalysisOutputUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <VibrationAnalysisOutputHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VibrationAnalysisOutputUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <VibrationAnalysisOutputHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @VibrationAnalysisOutputUpdated() {
%1 = call i32 (...) @VibrationAnalysisOutputHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @VibrationAnalysisOutputUpdated() {
%1 = tail call i32 (...) @VibrationAnalysisOutputHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int correctAnswerArithmetic(signed short user, signed short machine) {
  if (user == machine) {
    printf("Correct\n\n");
    return 1;
  } else {
    printf("Incorrect, start all over again\n\n");
    return 0;
  }
}


x86 assembly (clang, -O0):
<correctAnswerArithmetic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
movswl -0x6(%rbp),%eax
movswl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jne    114e <correctAnswerArithmetic+0x3e>
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1161 <correctAnswerArithmetic+0x51>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<correctAnswerArithmetic>:
push   %rbx
xor    %ebx,%ebx
cmp    %si,%di
sete   %bl
lea    0xf01(%rip),%rax
lea    0xed9(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Correct\0A\0A\00"
@.str.1 = [34 x i8] c"Incorrect, start all over again\0A\0A\00"
define i32 @correctAnswerArithmetic(i16 signext %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
%6 = load i16, i16* %4
%7 = sext i16 %6 to i32
%8 = load i16, i16* %5
%9 = sext i16 %8 to i32
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %3
br label %15
13: ; preds = %2
%14 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@str = [33 x i8] c"Incorrect, start all over again\0A\00"
@str.2 = [9 x i8] c"Correct\0A\00"
define i32 @correctAnswerArithmetic(i16 signext %0, i16 signext %1) {
%3 = icmp eq i16 %0, %1
%4 = select i1 %3, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0)
%5 = zext i1 %3 to i32
%6 = tail call i32 @puts(i8* dereferenceable(1) %4)
ret i32 %5
}
/* Type definitions */
struct Task {
  int dummy;
};

/* Variables and functions */
char *strdup(char *);
int /*<<< orphan*/ timecalc_set_busy(int);
char *handle_busy(char *arg, struct Task *tasks, unsigned n) {
  (void)arg, (void)tasks, (void)n;
  timecalc_set_busy(true);
  return strdup("You're assumed to be busy.");
}


x86 assembly (clang, -O0):
<handle_busy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    $0x1,%edi
call   1030 <timecalc_set_busy@plt>
lea    0xebc(%rip),%rdi
call   1040 <strdup@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handle_busy>:
push   %rax
mov    $0x1,%edi
call   1030 <timecalc_set_busy@plt>
lea    0xece(%rip),%rdi
pop    %rax
jmp    1040 <strdup@plt>

LLVM IR (-O0):
%struct.Task = type { i32 }
@.str = [27 x i8] c"You're assumed to be busy.\00"
define i8* @handle_busy(i8* %0, %struct.Task* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca %struct.Task*
%6 = alloca i32
store i8* %0, i8** %4
store %struct.Task* %1, %struct.Task** %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load %struct.Task*, %struct.Task** %5
%9 = load i32, i32* %6
%10 = call i32 @timecalc_set_busy(i32 1)
%11 = call i8* @strdup(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i8* %11
}

LLVM IR (-O2):
%struct.Task = type { i32 }
@.str = [27 x i8] c"You're assumed to be busy.\00"
define noalias i8* @handle_busy(i8* nocapture readnone %0, %struct.Task* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @timecalc_set_busy(i32 1)
%5 = tail call dereferenceable_or_null(27) i8* @strdup(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
ret i8* %5
}
int tools_is_char_operator(char ch) {
  int res = 1;
  switch (ch) {
  case '+':
  case '-':
  case '*':
  case '/': {
    res = 0;
    break;
  }
  }
  return res;
}


x86 assembly (clang, -O0):
<tools_is_char_operator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x1,-0x8(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0xc(%rbp)
add    $0xffffffd6,%eax
sub    $0x2,%eax
jb     114b <tools_is_char_operator+0x4b>
jmp    1129 <tools_is_char_operator+0x29>
mov    -0xc(%rbp),%eax
sub    $0x2d,%eax
je     114b <tools_is_char_operator+0x4b>
jmp    113a <tools_is_char_operator+0x3a>
mov    -0xc(%rbp),%eax
sub    $0x2f,%eax
jne    1152 <tools_is_char_operator+0x52>
jmp    114b <tools_is_char_operator+0x4b>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tools_is_char_operator>:
add    $0xffffffd6,%edi
mov    $0x1,%eax
cmp    $0x5,%edi
ja     111a <tools_is_char_operator+0x1a>
movslq %edi,%rax
lea    0xee9(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @tools_is_char_operator(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 1, i32* %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 43, label %6
i32 45, label %6
i32 42, label %6
i32 47, label %6
]
6: ; preds = %1, %1, %1, %1
store i32 0, i32* %3
br label %7
7: ; preds = %1, %6
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
@switch.table.tools_is_char_operator = [6 x i32] [i32 0, i32 0, i32 1, i32 0, i32 1, i32 0]
define i32 @tools_is_char_operator(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = add nsw i32 %2, -42
%4 = icmp ult i32 %3, 6
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = sext i32 %3 to i64
%7 = getelementptr inbounds [6 x i32], [6 x i32]* @switch.table.tools_is_char_operator, i64 0, i64 %6
%8 = load i32, i32* %7
br label %9
9: ; preds = %5, %1
%10 = phi i32 [ 1, %1 ], [ %8, %5 ]
ret i32 %10
}
int write(f, b, l)
char *b;
{ return (0); }


x86 assembly (clang, -O0):
<write>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @write(i32 %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
int ChkAesKeyLen(unsigned long len) {
  return len != 16 && len != 24 && len != 32 ? (0) : (1);
}


x86 assembly (clang, -O0):
<ChkAesKeyLen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x10,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1133 <ChkAesKeyLen+0x33>
xor    %eax,%eax
cmpq   $0x18,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1133 <ChkAesKeyLen+0x33>
cmpq   $0x20,-0x8(%rbp)
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%dl
mov    $0x1,%eax
xor    %ecx,%ecx
test   $0x1,%dl
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChkAesKeyLen>:
mov    %rdi,%rax
and    $0xfffffffffffffff7,%rax
cmp    $0x10,%rax
sete   %al
cmp    $0x20,%rdi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

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

LLVM IR (-O2):
define i32 @ChkAesKeyLen(i64 %0) {
%2 = and i64 %0, -9
%3 = icmp eq i64 %2, 16
%4 = icmp eq i64 %0, 32
%5 = or i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void menu_tree_display_root_text(char *display_text) {
  printf("\n");
  printf("%s\n", display_text);
  printf("---------------------------------------------------------------------"
         "----\n");
}


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

x86 assembly (clang, -O2):
<menu_tree_display_root_text>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xec3(%rip),%rdi
pop    %rbx
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@str = [74 x i8] c"-------------------------------------------------------------------------\00"
define void @menu_tree_display_root_text(i8* nocapture %0) {
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *stputbin(char const *, int /*<<< orphan*/, char *);
int /*<<< orphan*/ strlen(char const *);
char *stputs(const char *data, char *p) {
  return (stputbin(data, strlen(data), p));
}


x86 assembly (clang, -O0):
<stputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
call   1040 <stputbin@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stputs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <stputbin@plt>

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

LLVM IR (-O2):
define i8* @stputs(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i8* @stputbin(i8* %0, i32 %3, i8* %1)
ret i8* %4
}
/* Variables and functions */
int read(int /*<<< orphan*/, int *, int);
int main(int argc, char **argv) {
  int i, aux;
  do {
    i = read(0, &aux, 1);
  } while (i > 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
lea    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jg     1126 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
test   %eax,%eax
jg     1120 <main+0x10>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
br label %5
5: ; preds = %5, %2
%6 = call i32 @read(i32 0, i32* %3, i32 1)
%7 = icmp sgt i32 %6, 0
br i1 %7, label %5, label %8
8: ; preds = %5
ret i32 0
}
/* Type definitions */
struct wpa_ctrl {
  int dummy;
};

/* Variables and functions */
int wpa_ctrl_command(struct wpa_ctrl *, char *);
int wpa_cli_cmd_scan_results(struct wpa_ctrl *ctrl, int argc,
                             const char *argv[]) {
  return wpa_ctrl_command(ctrl, "SCAN_RESULTS");
}


x86 assembly (clang, -O0):
<wpa_cli_cmd_scan_results>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
call   1030 <wpa_ctrl_command@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wpa_cli_cmd_scan_results>:
lea    0xee9(%rip),%rsi
jmp    1030 <wpa_ctrl_command@plt>

LLVM IR (-O0):
%struct.wpa_ctrl = type { i32 }
@.str = [13 x i8] c"SCAN_RESULTS\00"
define i32 @wpa_cli_cmd_scan_results(%struct.wpa_ctrl* %0, i32 %1, i8** %2) {
%4 = alloca %struct.wpa_ctrl*
%5 = alloca i32
%6 = alloca i8**
store %struct.wpa_ctrl* %0, %struct.wpa_ctrl** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load %struct.wpa_ctrl*, %struct.wpa_ctrl** %4
%8 = call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %8
}

LLVM IR (-O2):
%struct.wpa_ctrl = type { i32 }
@.str = [13 x i8] c"SCAN_RESULTS\00"
define i32 @wpa_cli_cmd_scan_results(%struct.wpa_ctrl* %0, i32 %1, i8** nocapture readnone %2) {
%4 = tail call i32 @wpa_ctrl_command(%struct.wpa_ctrl* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 %4
}
unsigned short creal_fun_complexOf_ushort(unsigned a) { return a >> 16; }


x86 assembly (clang, -O0):
<creal_fun_complexOf_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x10,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<creal_fun_complexOf_ushort>:
mov    %edi,%eax
shr    $0x10,%eax
ret

LLVM IR (-O0):
define zeroext i16 @creal_fun_complexOf_ushort(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 16
%5 = trunc i32 %4 to i16
ret i16 %5
}

LLVM IR (-O2):
define zeroext i16 @creal_fun_complexOf_ushort(i32 %0) {
%2 = lshr i32 %0, 16
%3 = trunc i32 %2 to i16
ret i16 %3
}
double __attribute__((const)) carg(double _Complex _Z) {
  double res;
  __asm__("fpatan;" : "=t"(res) : "0"(__real__ _Z), "u"(__imag__ _Z) : "st(1)");
  return res;
}


x86 assembly (clang, -O0):
<carg>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
fldl   -0x20(%rbp)
fldl   -0x28(%rbp)
fxch   %st(1)
fpatan
fstpl  -0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<carg>:
movsd  %xmm0,-0x8(%rsp)
movsd  %xmm1,-0x10(%rsp)
fldl   -0x8(%rsp)
fldl   -0x10(%rsp)
fxch   %st(1)
fpatan
fstpl  -0x18(%rsp)
movsd  -0x18(%rsp),%xmm0
ret

LLVM IR (-O0):
define double @carg(double %0, double %1) {
%3 = alloca { double, double }
%4 = alloca double
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %6
%7 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%10 = load double, double* %9
%11 = call double asm "fpatan;", "={st},0,{st(1)},~{st(1)},~{dirflag},~{fpsr},~{flags}"(double %8, double %10)
store double %11, double* %4
%12 = load double, double* %4
ret double %12
}

LLVM IR (-O2):
define double @carg(double %0, double %1) {
%3 = tail call double asm "fpatan;", "={st},0,{st(1)},~{st(1)},~{dirflag},~{fpsr},~{flags}"(double %0, double %1)
ret double %3
}
/* Variables and functions */
scalar_t__ cryptcmp(char const *, char const *);
int fw_validate_user(const char *user, const char *fwpass, const char *method,
                     const char *pass) {
  if (cryptcmp(pass, fwpass) == 0) {
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<fw_validate_user>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <cryptcmp@plt>
cmp    $0x0,%rax
jne    114b <fw_validate_user+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1152 <fw_validate_user+0x42>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fw_validate_user>:
push   %rax
mov    %rcx,%rdi
call   1030 <cryptcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fw_validate_user(i8* nocapture readnone %0, i8* %1, i8* nocapture readnone %2, i8* %3) {
%5 = tail call i64 @cryptcmp(i8* %3, i8* %1)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
int test_imm_A2uint8_mem(unsigned char *val) {
  return ((*val) & (-0xA2 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A2uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -162
%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_A2uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 94
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ tty_show(int /*<<< orphan*/);
void tty_string(char *p) {
  while (*p)
    tty_show(*p++);
}


x86 assembly (clang, -O0):
<tty_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1145 <tty_string+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <tty_show@plt>
jmp    111c <tty_string+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_string>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <tty_string+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <tty_show@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <tty_string+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @tty_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 @tty_show(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
/* Variables and functions */
size_t send(int, char *, scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int, char const *);
scalar_t__ strlen(char const *);
size_t send_data(int fd, char *send_buffer, const char *data) {
  sprintf(send_buffer, "$%02x %s", (unsigned int)strlen(data), data);
  return send(fd, send_buffer, strlen(send_buffer), 0);
}


x86 assembly (clang, -O0):
<send_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%edx
mov    -0x18(%rbp),%rcx
lea    0xe9b(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x24(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    %rax,%rdx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_data>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rdx,%rdi
call   1030 <strlen@plt>
lea    0xeb5(%rip),%rsi
mov    %rbx,%rdi
mov    %eax,%edx
mov    %r14,%rcx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %ecx,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <send@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"$%02x %s\00"
define i64 @send_data(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = load i8*, i8** %6
%9 = call i64 @strlen(i8* %8)
%10 = trunc i64 %9 to i32
%11 = load i8*, i8** %6
%12 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %11)
%13 = load i32, i32* %4
%14 = load i8*, i8** %5
%15 = load i8*, i8** %5
%16 = call i64 @strlen(i8* %15)
%17 = call i64 @send(i32 %13, i8* %14, i64 %16, i32 0)
ret i64 %17
}

LLVM IR (-O2):
@.str = [9 x i8] c"$%02x %s\00"
define i64 @send_data(i32 %0, i8* %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%5 = trunc i64 %4 to i32
%6 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %2)
%7 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%8 = tail call i64 @send(i32 %0, i8* %1, i64 %7, i32 0)
ret i64 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
main() {
  int i = 0;
  for (i = 0; i <= 5; i++) {
    if (i < 3) {
      printf("Hello World\n");
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x5,-0x8(%rbp)
jg     1160 <main+0x50>
cmpl   $0x3,-0x8(%rbp)
jge    114d <main+0x3d>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
jmp    1152 <main+0x42>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    112d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

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))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%3 = 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 */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRC9_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

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

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

LLVM IR (-O2):
define void @U_WMRC9_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
unsigned int mget4l(const uint8_t *data) {
  return data[0] | (data[1] * 0x0100) | (data[2] * 0x010000) |
         (data[3] * 0x01000000);
}


x86 assembly (clang, -O0):
<mget4l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mget4l>:
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @mget4l(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = mul nsw i32 %8, 256
%10 = or i32 %5, %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = mul nsw i32 %13, 65536
%15 = or i32 %10, %14
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = mul nsw i32 %18, 16777216
%20 = or i32 %15, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @mget4l(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl nsw i32 %4, 8
%6 = or i32 %5, %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = shl nsw i32 %8, 16
%10 = or i32 %6, %9
%11 = getelementptr inbounds i32, i32* %0, i64 3
%12 = load i32, i32* %11
%13 = shl nsw i32 %12, 24
%14 = or i32 %10, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ GlobalThermonuclearWar();
int /*<<< orphan*/ LoginSuccess();
scalar_t__ LoginWopr();
int /*<<< orphan*/ WoprChat();
int /*<<< orphan*/ clearScreen();
void woprCmd() {
  clearScreen();
  if (LoginWopr()) {
    LoginSuccess();
    WoprChat();
    GlobalThermonuclearWar();
  }
}


x86 assembly (clang, -O0):
<woprCmd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <clearScreen@plt>
mov    $0x0,%al
call   1050 <LoginWopr@plt>
cmp    $0x0,%rax
je     1181 <woprCmd+0x31>
mov    $0x0,%al
call   1060 <LoginSuccess@plt>
mov    $0x0,%al
call   1030 <WoprChat@plt>
mov    $0x0,%al
call   1070 <GlobalThermonuclearWar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<woprCmd>:
push   %rax
xor    %eax,%eax
call   1040 <clearScreen@plt>
xor    %eax,%eax
call   1050 <LoginWopr@plt>
test   %rax,%rax
je     117a <woprCmd+0x2a>
xor    %eax,%eax
call   1060 <LoginSuccess@plt>
xor    %eax,%eax
call   1030 <WoprChat@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <GlobalThermonuclearWar@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @woprCmd() {
%1 = call i32 (...) @clearScreen()
%2 = call i64 (...) @LoginWopr()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %0
%5 = call i32 (...) @LoginSuccess()
%6 = call i32 (...) @WoprChat()
%7 = call i32 (...) @GlobalThermonuclearWar()
br label %8
8: ; preds = %4, %0
ret void
}

LLVM IR (-O2):
define void @woprCmd() {
%1 = tail call i32 (...) @clearScreen()
%2 = tail call i64 (...) @LoginWopr()
%3 = icmp eq i64 %2, 0
br i1 %3, label %8, label %4
4: ; preds = %0
%5 = tail call i32 (...) @LoginSuccess()
%6 = tail call i32 (...) @WoprChat()
%7 = tail call i32 (...) @GlobalThermonuclearWar()
br label %8
8: ; preds = %4, %0
ret void
}
int unused_func(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @unused_func() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct dynar {
  int dummy;
};
typedef int /*<<< orphan*/ nlen;

/* Variables and functions */
scalar_t__ dynar_data(struct dynar *);
int /*<<< orphan*/ htonl(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(scalar_t__, int /*<<< orphan*/ *, int);
void msg_set_len(struct dynar *msg, uint32_t len) {
  uint32_t nlen;
  nlen = htonl(len);
  memcpy(dynar_data(msg) + 2, &nlen, sizeof(nlen));
}


x86 assembly (clang, -O0):
<msg_set_len>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <htonl@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dynar_data@plt>
mov    %rax,%rdi
add    $0x2,%rdi
lea    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<msg_set_len>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <htonl@plt>
mov    %eax,0xc(%rsp)
mov    %rbx,%rdi
call   1040 <dynar_data@plt>
lea    0x2(%rax),%rdi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.dynar = type { i32 }
define void @msg_set_len(%struct.dynar* %0, i32 %1) {
%3 = alloca %struct.dynar*
%4 = alloca i32
%5 = alloca i32
store %struct.dynar* %0, %struct.dynar** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @htonl(i32 %6)
store i32 %7, i32* %5
%8 = load %struct.dynar*, %struct.dynar** %3
%9 = call i64 @dynar_data(%struct.dynar* %8)
%10 = add nsw i64 %9, 2
%11 = call i32 @memcpy(i64 %10, i32* %5, i32 4)
ret void
}

LLVM IR (-O2):
%struct.dynar = type { i32 }
define void @msg_set_len(%struct.dynar* %0, i32 %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @htonl(i32 %1)
store i32 %5, i32* %3
%6 = tail call i64 @dynar_data(%struct.dynar* %0)
%7 = add nsw i64 %6, 2
%8 = call i32 @memcpy(i64 %7, i32* %3, i32 4)
ret void
}
void fdmi_dtype_op_MIN_double(void *a, void *b) {
  (*(double *)a =
       (((*(double *)a) < (*(double *)b)) ? *(double *)a : *(double *)b));
}


x86 assembly (clang, -O0):
<fdmi_dtype_op_MIN_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1138 <fdmi_dtype_op_MIN_double+0x38>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1145 <fdmi_dtype_op_MIN_double+0x45>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdmi_dtype_op_MIN_double>:
movsd  (%rdi),%xmm0
minsd  (%rsi),%xmm0
movsd  %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @fdmi_dtype_op_MIN_double(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 = bitcast i8* %5 to double*
%7 = load double, double* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to double*
%10 = load double, double* %9
%11 = fcmp olt double %7, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = bitcast i8* %13 to double*
%15 = load double, double* %14
br label %20
16: ; preds = %2
%17 = load i8*, i8** %4
%18 = bitcast i8* %17 to double*
%19 = load double, double* %18
br label %20
20: ; preds = %16, %12
%21 = phi double [ %15, %12 ], [ %19, %16 ]
%22 = load i8*, i8** %3
%23 = bitcast i8* %22 to double*
store double %21, double* %23
ret void
}

LLVM IR (-O2):
define void @fdmi_dtype_op_MIN_double(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = select i1 %7, double %4, double %6
store double %8, double* %3
ret void
}
int iptables_delete_mark_rule(int table, char *protocol,
                              struct in6_addr *ip_orig,
                              struct in6_addr *ip_dest, int dest_port,
                              int orig_port, int mark) {
  return 1;
}


x86 assembly (clang, -O0):
<iptables_delete_mark_rule>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.in6_addr = type opaque
define i32 @iptables_delete_mark_rule(i32 %0, i8* %1, %struct.in6_addr* %2, %struct.in6_addr* %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca %struct.in6_addr*
%11 = alloca %struct.in6_addr*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i8* %1, i8** %9
store %struct.in6_addr* %2, %struct.in6_addr** %10
store %struct.in6_addr* %3, %struct.in6_addr** %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
ret i32 1
}

LLVM IR (-O2):
%struct.in6_addr = type opaque
define i32 @iptables_delete_mark_rule(i32 %0, i8* nocapture readnone %1, %struct.in6_addr* nocapture readnone %2, %struct.in6_addr* nocapture readnone %3, i32 %4, i32 %5, i32 %6) {
ret i32 1
}
void inc_zcache_failed_pers_puts(void) {}


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

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

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

LLVM IR (-O2):
define void @inc_zcache_failed_pers_puts() {
ret void
}
int test_imm_15int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0x15 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_15int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 90194313216
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int int8_t;
typedef int /*<<< orphan*/ input;
typedef int /*<<< orphan*/ expected;

/* Variables and functions */
int /*<<< orphan*/ test_rebase(int, int *, int, int, int *, int);
void test_hex_to_trinary(void) {
  int8_t input[] = {2, 10};
  int8_t expected[] = {1, 1, 2, 0};
  test_rebase(16, input, (sizeof(input) / sizeof(input[0])), 3, expected,
              (sizeof(expected) / sizeof(expected[0])));
}


x86 assembly (clang, -O0):
<test_hex_to_trinary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xee1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xee6(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rsi
lea    -0x20(%rbp),%r8
mov    $0x10,%edi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r9d
call   1030 <test_rebase@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_hex_to_trinary>:
sub    $0x28,%rsp
movabs $0xa00000002,%rax
mov    %rax,0x8(%rsp)
movaps 0xed6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%r8
mov    $0x10,%edi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r9d
call   1030 <test_rebase@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_hex_to_trinary.input = [2 x i32] [i32 2, i32 10]
@__const.test_hex_to_trinary.expected = [4 x i32] [i32 1, i32 1, i32 2, i32 0]
define void @test_hex_to_trinary() {
%1 = alloca [2 x i32]
%2 = alloca [4 x i32]
%3 = bitcast [2 x i32]* %1 to i8*
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %1, i64 0, i64 0
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @test_rebase(i32 16, i32* %5, i32 2, i32 3, i32* %6, i32 4)
ret void
}

LLVM IR (-O2):
@__const.test_hex_to_trinary.expected = [4 x i32] [i32 1, i32 1, i32 2, i32 0]
define void @test_hex_to_trinary() {
%1 = alloca i64
%2 = alloca [4 x i32]
%3 = bitcast i64* %1 to i8*
store i64 42949672962, i64* %1
%4 = bitcast [4 x i32]* %2 to i8*
%5 = bitcast i64* %1 to i32*
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%7 = call i32 @test_rebase(i32 16, i32* %5, i32 2, i32 3, i32* %6, i32 4)
ret void
}
unsigned long nextIndex(unsigned long index, unsigned long N) {
  return (index + 1) % N;
}


x86 assembly (clang, -O0):
<nextIndex>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nextIndex>:
mov    %rdi,%rax
add    $0x1,%rax
mov    %rax,%rcx
or     %rsi,%rcx
shr    $0x20,%rcx
je     111c <nextIndex+0x1c>
xor    %edx,%edx
div    %rsi
mov    %rdx,%rax
ret
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i64 @nextIndex(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 = add i64 %5, 1
%7 = load i64, i64* %4
%8 = urem i64 %6, %7
ret i64 %8
}

LLVM IR (-O2):
define i64 @nextIndex(i64 %0, i64 %1) {
%3 = add i64 %0, 1
%4 = urem i64 %3, %1
ret i64 %4
}
int launch_clients(int num_client) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @launch_clients(i32 %0) {
ret i32 0
}
/* Type definitions */
struct node {
  int dummy;
};

/* Variables and functions */
int height(struct node *);
int /*<<< orphan*/ printGivenLevel(struct node *, int);
void printLevelOrder(struct node *root) {
  int h = height(root);
  int i;
  for (i = 1; i <= h; i++)
    printGivenLevel(root, i);
}


x86 assembly (clang, -O0):
<printLevelOrder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <height@plt>
mov    %eax,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     1165 <printLevelOrder+0x45>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
call   1030 <printGivenLevel@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113f <printLevelOrder+0x1f>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLevelOrder>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1040 <height@plt>
test   %eax,%eax
jle    115d <printLevelOrder+0x3d>
mov    %eax,%r15d
neg    %r15d
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printGivenLevel@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1140 <printLevelOrder+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.node = type { i32 }
define void @printLevelOrder(%struct.node* %0) {
%2 = alloca %struct.node*
%3 = alloca i32
%4 = alloca i32
store %struct.node* %0, %struct.node** %2
%5 = load %struct.node*, %struct.node** %2
%6 = call i32 @height(%struct.node* %5)
store i32 %6, i32* %3
store i32 1, i32* %4
br label %7
7: ; preds = %15, %1
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = icmp sle i32 %8, %9
br i1 %10, label %11, label %18
11: ; preds = %7
%12 = load %struct.node*, %struct.node** %2
%13 = load i32, i32* %4
%14 = call i32 @printGivenLevel(%struct.node* %12, i32 %13)
br label %15
15: ; preds = %11
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 1
store i32 %17, i32* %4
br label %7
18: ; preds = %7
ret void
}

LLVM IR (-O2):
%struct.node = type { i32 }
define void @printLevelOrder(%struct.node* %0) {
%2 = tail call i32 @height(%struct.node* %0)
%3 = icmp slt i32 %2, 1
br i1 %3, label %9, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 1, %1 ]
%6 = tail call i32 @printGivenLevel(%struct.node* %0, i32 %5)
%7 = add nuw i32 %5, 1
%8 = icmp eq i32 %5, %2
br i1 %8, label %9, label %4
9: ; preds = %4, %1
ret void
}
/* Variables and functions */
scalar_t__ strstr(char *, char *);
bool isSubstring(char *haystack, char *needle) {
  return strstr(haystack, needle) ? true : false;
}


x86 assembly (clang, -O0):
<isSubstring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSubstring>:
push   %rax
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @isSubstring(i8* %0, i8* %1) {
%3 = tail call i64 @strstr(i8* %0, i8* %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
double ruspma_rand_decimal();
double arm1(void) { return ruspma_rand_decimal() / 0.02; }


x86 assembly (clang, -O0):
<arm1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ruspma_rand_decimal@plt>
movsd  0xedd(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm1>:
push   %rax
xor    %eax,%eax
call   1030 <ruspma_rand_decimal@plt>
divsd  0xee0(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @arm1() {
%1 = call double (...) @ruspma_rand_decimal()
%2 = fdiv double %1, 2.000000e-02
ret double %2
}

LLVM IR (-O2):
define double @arm1() {
%1 = tail call double (...) @ruspma_rand_decimal()
%2 = fdiv double %1, 2.000000e-02
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ portctl(char, int, char *);
int ctcsson() {
  int pin = 0;
  char mask = 0x10;
  portctl(mask, pin, "ctcsson");
  return 1;
}


x86 assembly (clang, -O0):
<ctcsson>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x10,-0x5(%rbp)
mov    -0x5(%rbp),%al
mov    -0x4(%rbp),%esi
lea    0xed0(%rip),%rdx
movsbl %al,%edi
call   1030 <portctl@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctcsson>:
push   %rax
lea    0xee8(%rip),%rdx
mov    $0x10,%edi
xor    %esi,%esi
call   1030 <portctl@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"ctcsson\00"
define i32 @ctcsson() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
store i8 16, i8* %2
%3 = load i8, i8* %2
%4 = load i32, i32* %1
%5 = call i32 @portctl(i8 signext %3, i32 %4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [8 x i8] c"ctcsson\00"
define i32 @ctcsson() {
%1 = tail call i32 @portctl(i8 signext 16, i32 0, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 1
}