xunge/DecIR huggingface dataset:
unsigned xrop3_177_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = S ^ T;
  stk2 = D | stk3;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


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

x86 assembly (clang, -O2):
<xrop3_177_0_0>:
shl    $0x8,%edi
mov    %esi,%eax
shl    $0x8,%eax
lea    (%rsi,%rax,1),%ecx
xor    %edi,%eax
or     $0xff,%eax
xor    %ecx,%eax
not    %eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_177_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = shl nuw nsw i32 %3, 8
%5 = zext i8 %1 to i32
%6 = shl nuw nsw i32 %5, 8
%7 = or i32 %6, %5
%8 = xor i32 %6, %4
%9 = or i32 %8, 255
%10 = xor i32 %7, %9
%11 = xor i32 %10, -1
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdout;
void vt100_cursor_up(void) {
  printf("\x1B[A");
  fflush(stdout);
}


x86 assembly (clang, -O0):
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"\1B[A\00"
@stdout = global i32 0
define void @vt100_cursor_up() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"\1B[A\00"
@stdout = global i32 0
define void @vt100_cursor_up() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ UI_MainMenu();
int /*<<< orphan*/ UI_PopMenu();
void UI_SPSkillMenu_MainEvent(void *ptr, int notification) {
  if (notification != 3) {
    return;
  }
  UI_PopMenu();
  UI_MainMenu();
}


x86 assembly (clang, -O0):
<UI_SPSkillMenu_MainEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
je     113e <UI_SPSkillMenu_MainEvent+0x1e>
jmp    114c <UI_SPSkillMenu_MainEvent+0x2c>
mov    $0x0,%al
call   1040 <UI_PopMenu@plt>
mov    $0x0,%al
call   1030 <UI_MainMenu@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_SPSkillMenu_MainEvent>:
cmp    $0x3,%esi
jne    1135 <UI_SPSkillMenu_MainEvent+0x15>
push   %rax
xor    %eax,%eax
call   1040 <UI_PopMenu@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <UI_MainMenu@plt>
ret

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

LLVM IR (-O2):
define void @UI_SPSkillMenu_MainEvent(i8* nocapture readnone %0, i32 %1) {
%3 = icmp eq i32 %1, 3
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 (...) @UI_PopMenu()
%6 = tail call i32 (...) @UI_MainMenu()
br label %7
7: ; preds = %2, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int func(void) {
  printf("zx1\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"zx1\0A\00"
define i32 @func() {
%1 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [4 x i8] c"zx1\00"
define i32 @func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int get_year(float R) {
  int i = 0;
  double area = 3.1415926 * R * R / 2;
  int sum;
  while ((sum = i * 50) <= area) {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<get_year>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xee7(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
imul   $0x32,-0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
cvtsi2sd %eax,%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     116b <get_year+0x6b>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1143 <get_year+0x43>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_year>:
cvtss2sd %xmm0,%xmm1
movsd  0xef4(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  0xeec(%rip),%xmm0
mov    $0xffffffff,%eax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
add    $0x1,%eax
add    $0x32,%ecx
ucomisd %xmm1,%xmm0
jae    1130 <get_year+0x30>
ret

LLVM IR (-O0):
define i32 @get_year(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca double
%5 = alloca i32
store float %0, float* %2
store i32 0, i32* %3
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fmul double 0x400921FB4D12D84A, %7
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = fmul double %8, %10
%12 = fdiv double %11, 2.000000e+00
store double %12, double* %4
br label %13
13: ; preds = %19, %1
%14 = load i32, i32* %3
%15 = mul nsw i32 %14, 50
store i32 %15, i32* %5
%16 = sitofp i32 %15 to double
%17 = load double, double* %4
%18 = fcmp ole double %16, %17
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %13
22: ; preds = %13
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @get_year(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 0x400921FB4D12D84A
%4 = fmul double %3, %2
%5 = fmul double %4, 5.000000e-01
br label %6
6: ; preds = %6, %1
%7 = phi i32 [ 0, %1 ], [ %11, %6 ]
%8 = mul nsw i32 %7, 50
%9 = sitofp i32 %8 to double
%10 = fcmp ult double %5, %9
%11 = add nuw nsw i32 %7, 1
br i1 %10, label %12, label %6
12: ; preds = %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("To C, or not to C: That is the question.\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"To C, or not to C: That is the question.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [41 x i8] c"To C, or not to C: That is the question.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
ret i32 0
}
unsigned supereagle_generic_input_fmts(void) { return (1 << 0) | (1 << 1); }


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

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

LLVM IR (-O0):
define i32 @supereagle_generic_input_fmts() {
ret i32 3
}

LLVM IR (-O2):
define i32 @supereagle_generic_input_fmts() {
ret i32 3
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int);
uint64_t dangerous_add_2(int lhs, int rhs) {
  if (lhs < 0)
    exit(1);
  if (rhs < 0)
    abort();
  return lhs + rhs;
}


x86 assembly (clang, -O0):
<dangerous_add_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1142 <dangerous_add_2+0x22>
mov    $0x1,%edi
call   1040 <exit@plt>
cmpl   $0x0,-0x8(%rbp)
jge    1153 <dangerous_add_2+0x33>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dangerous_add_2>:
push   %rax
test   %edi,%edi
js     112f <dangerous_add_2+0xf>
test   %esi,%esi
js     1139 <dangerous_add_2+0x19>
add    %edi,%esi
mov    %esi,%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %eax,%eax
call   1030 <abort@plt>

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

LLVM IR (-O2):
define i32 @dangerous_add_2(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %2
%7 = icmp slt i32 %1, 0
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %6
%11 = add nuw nsw i32 %1, %0
ret i32 %11
}
/* Variables and functions */
scalar_t__ isdigit(int);
int isNonzeroDigit(int c) { return isdigit(c) && (c != '0'); }


x86 assembly (clang, -O0):
<isNonzeroDigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
je     113f <isNonzeroDigit+0x2f>
cmpl   $0x30,-0x4(%rbp)
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNonzeroDigit>:
push   %rbx
mov    %edi,%ebx
call   1030 <isdigit@plt>
test   %rax,%rax
setne  %al
cmp    $0x30,%ebx
setne  %cl
and    %al,%cl
movzbl %cl,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @isNonzeroDigit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @isdigit(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 48
br label %9
9: ; preds = %6, %1
%10 = phi i1 [ false, %1 ], [ %8, %6 ]
%11 = zext i1 %10 to i32
ret i32 %11
}

LLVM IR (-O2):
define i32 @isNonzeroDigit(i32 %0) {
%2 = tail call i64 @isdigit(i32 %0)
%3 = icmp ne i64 %2, 0
%4 = icmp ne i32 %0, 48
%5 = and i1 %4, %3
%6 = zext i1 %5 to i32
ret i32 %6
}
void
    __attribute__((warning("curl_easy_setopt expects a "
                           "private data pointer as argument for this option")))
    __attribute__((unused)) __attribute__((no))
    _curl_easy_setopt_err_cb_data(void) {
  __asm__("");
}


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

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

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

LLVM IR (-O2):
define void @_curl_easy_setopt_err_cb_data() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ *strstr(char const *, char const *);
bool stringContainsSubtring(const char *string, const char *substring) {
  if (strstr(string, substring) != NULL) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<stringContainsSubtring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
cmp    $0x0,%rax
je     1143 <stringContainsSubtring+0x33>
movl   $0x1,-0x4(%rbp)
jmp    114a <stringContainsSubtring+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringContainsSubtring>:
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 @stringContainsSubtring(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i32* @strstr(i8* %6, i8* %7)
%9 = icmp ne i32* %8, null
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %12
11: ; preds = %2
store i32 0, i32* %3
br label %12
12: ; preds = %11, %10
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @stringContainsSubtring(i8* %0, i8* nocapture %1) {
%3 = tail call i32* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
double obd_convert_5E(int a, int b) { return (double)((a * 256) + b) / 20.0f; }


x86 assembly (clang, -O0):
<obd_convert_5E>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
add    -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee1(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<obd_convert_5E>:
shl    $0x8,%edi
add    %esi,%edi
cvtsi2sd %edi,%xmm0
divsd  0xeef(%rip),%xmm0
ret

LLVM IR (-O0):
define double @obd_convert_5E(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = mul nsw i32 %5, 256
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 2.000000e+01
ret double %10
}

LLVM IR (-O2):
define double @obd_convert_5E(i32 %0, i32 %1) {
%3 = shl nsw i32 %0, 8
%4 = add nsw i32 %3, %1
%5 = sitofp i32 %4 to double
%6 = fdiv double %5, 2.000000e+01
ret double %6
}
int qemu_spice_migrate_info(const char *h, int p, int t, const char *s) {
  return -1;
}


x86 assembly (clang, -O0):
<qemu_spice_migrate_info>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @qemu_spice_migrate_info(i8* nocapture readnone %0, i32 %1, i32 %2, i8* nocapture readnone %3) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_85(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_85() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int EINVAL;
int ENOTSUP;
int PTHREAD_SCOPE_PROCESS;
int PTHREAD_SCOPE_SYSTEM;
int pthread_attr_setscope(pthread_attr_t *attr, int scope) {
  (void)attr;
  if (scope == PTHREAD_SCOPE_SYSTEM)
    return 0;
  if (scope == PTHREAD_SCOPE_PROCESS)
    return ENOTSUP;
  return EINVAL;
}


x86 assembly (clang, -O0):
<pthread_attr_setscope>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2ecb(%rip),%rcx
cmp    (%rcx),%eax
jne    1129 <pthread_attr_setscope+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1158 <pthread_attr_setscope+0x58>
mov    -0x14(%rbp),%eax
mov    0x2e9d(%rip),%rcx
cmp    (%rcx),%eax
jne    114c <pthread_attr_setscope+0x4c>
mov    0x2ea6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1158 <pthread_attr_setscope+0x58>
mov    0x2e75(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_attr_setscope>:
mov    0x2ed9(%rip),%rcx
xor    %eax,%eax
cmp    %esi,(%rcx)
je     112a <pthread_attr_setscope+0x2a>
mov    0x2ebc(%rip),%rax
cmp    %esi,(%rax)
jne    1121 <pthread_attr_setscope+0x21>
mov    0x2ec9(%rip),%rax
jmp    1128 <pthread_attr_setscope+0x28>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@PTHREAD_SCOPE_SYSTEM = global i32 0
@PTHREAD_SCOPE_PROCESS = global i32 0
@ENOTSUP = global i32 0
@EINVAL = global i32 0
define i32 @pthread_attr_setscope(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%6 = load i32*, i32** %4
%7 = load i32, i32* %5
%8 = load i32, i32* @PTHREAD_SCOPE_SYSTEM
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 0, i32* %3
br label %19
11: ; preds = %2
%12 = load i32, i32* %5
%13 = load i32, i32* @PTHREAD_SCOPE_PROCESS
%14 = icmp eq i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i32, i32* @ENOTSUP
store i32 %16, i32* %3
br label %19
17: ; preds = %11
%18 = load i32, i32* @EINVAL
store i32 %18, i32* %3
br label %19
19: ; preds = %17, %15, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@PTHREAD_SCOPE_SYSTEM = global i32 0
@PTHREAD_SCOPE_PROCESS = global i32 0
@ENOTSUP = global i32 0
@EINVAL = global i32 0
define i32 @pthread_attr_setscope(i32* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @PTHREAD_SCOPE_SYSTEM
%4 = icmp eq i32 %3, %1
br i1 %4, label %12, label %5
5: ; preds = %2
%6 = load i32, i32* @PTHREAD_SCOPE_PROCESS
%7 = icmp eq i32 %6, %1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = load i32, i32* @ENOTSUP
br label %12
10: ; preds = %5
%11 = load i32, i32* @EINVAL
br label %12
12: ; preds = %2, %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ], [ 0, %2 ]
ret i32 %13
}
/* Variables and functions */
int EINVAL;
int ENOTSUP;
int errno;
int rename(const char *old, const char *new) {
  if (!old || !new) {
    errno = EINVAL;
    return (EINVAL);
  }
  errno = ENOTSUP;
  return (ENOTSUP);
}


x86 assembly (clang, -O0):
<rename>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1122 <rename+0x22>
cmpq   $0x0,-0x18(%rbp)
jne    1145 <rename+0x45>
mov    0x2ea7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea6(%rip),%rax
mov    %ecx,(%rax)
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1163 <rename+0x63>
mov    0x2e9c(%rip),%rax
mov    (%rax),%ecx
mov    0x2e83(%rip),%rax
mov    %ecx,(%rax)
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rename>:
mov    0x2ec9(%rip),%rax
mov    %rax,%rcx
test   %rsi,%rsi
je     1116 <rename+0x16>
mov    0x2ed2(%rip),%rcx
test   %rdi,%rdi
cmovne %rcx,%rax
mov    (%rax),%eax
mov    0x2eb2(%rip),%rcx
mov    %eax,(%rcx)
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
@ENOTSUP = global i32 0
define i32 @rename(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %14, label %11
11: ; preds = %8, %2
%12 = load i32, i32* @EINVAL
store i32 %12, i32* @errno
%13 = load i32, i32* @EINVAL
store i32 %13, i32* %3
br label %17
14: ; preds = %8
%15 = load i32, i32* @ENOTSUP
store i32 %15, i32* @errno
%16 = load i32, i32* @ENOTSUP
store i32 %16, i32* %3
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
@ENOTSUP = global i32 0
define i32 @rename(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
%6 = load i32, i32* @ENOTSUP
%7 = load i32, i32* @EINVAL
%8 = select i1 %5, i32 %6, i32 %7
store i32 %8, i32* @errno
ret i32 %8
}
int test_imm_72int32_reg(int val) { return ((val) & (0x72 << 0)) ? -20 : -40; }


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

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

LLVM IR (-O0):
define i32 @test_imm_72int32_reg(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 114
%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_72int32_reg(i32 %0) {
%2 = and i32 %0, 114
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int test3(int a, int b, int c) {
  int x = 0;
  x = a;
  if (c > 0) {
    a = b;
  } else {
    x = c;
  }
  return (x + a + b - c);
}


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    112f <test3+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1135 <test3+0x35>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
test   %edx,%edx
mov    %edi,%eax
cmovg  %esi,%eax
cmovle %edx,%edi
sub    %edx,%esi
add    %esi,%eax
add    %edi,%eax
ret

LLVM IR (-O0):
define i32 @test3(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
%8 = load i32, i32* %4
store i32 %8, i32* %7
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i32, i32* %5
store i32 %12, i32* %4
br label %15
13: ; preds = %3
%14 = load i32, i32* %6
store i32 %14, i32* %7
br label %15
15: ; preds = %13, %11
%16 = load i32, i32* %7
%17 = load i32, i32* %4
%18 = add nsw i32 %16, %17
%19 = load i32, i32* %5
%20 = add nsw i32 %18, %19
%21 = load i32, i32* %6
%22 = sub nsw i32 %20, %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @test3(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
%5 = select i1 %4, i32 %1, i32 %0
%6 = select i1 %4, i32 %0, i32 %2
%7 = sub i32 %1, %2
%8 = add i32 %7, %5
%9 = add i32 %8, %6
ret i32 %9
}
/* Variables and functions */
int real_gethostname(char *, size_t);
int /*<<< orphan*/ strncpy(char *, char const *, size_t);
int gethostname(char *name, size_t len) {
  const char *val;
  val = "emi-ui.localdomain";
  if (val != NULL) {
    strncpy(name, val, len);
    return 0;
  }
  return real_gethostname(name, len);
}


x86 assembly (clang, -O0):
<gethostname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    0xec9(%rip),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1163 <gethostname+0x43>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <strncpy@plt>
movl   $0x0,-0x4(%rbp)
jmp    1173 <gethostname+0x53>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <real_gethostname@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gethostname>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <strncpy@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"emi-ui.localdomain\00"
define i32 @gethostname(i8* %0, i64 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %6
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8*, i8** %4
%11 = load i8*, i8** %6
%12 = load i64, i64* %5
%13 = call i32 @strncpy(i8* %10, i8* %11, i64 %12)
store i32 0, i32* %3
br label %18
14: ; preds = %2
%15 = load i8*, i8** %4
%16 = load i64, i64* %5
%17 = call i32 @real_gethostname(i8* %15, i64 %16)
store i32 %17, i32* %3
br label %18
18: ; preds = %14, %9
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
@.str = [19 x i8] c"emi-ui.localdomain\00"
define i32 @gethostname(i8* %0, i64 %1) {
%3 = tail call i32 @strncpy(i8* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i32 0
}
struct op *findcase(t, w)
struct op *t;
char *w;
{
  register struct op **tp;
  return ((tp = find1case(t, w)) != 0 ? *tp : (struct op *)0);
}


x86 assembly (clang, -O0):
<findcase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1030 <find1case@plt>
cltq
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
je     114f <findcase+0x3f>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
jmp    115a <findcase+0x4a>
xor    %eax,%eax
mov    %rax,-0x20(%rbp)
jmp    115a <findcase+0x4a>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findcase>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <find1case@plt>
test   %eax,%eax
je     1123 <findcase+0x13>
cltq
mov    (%rax),%rbx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.op = type opaque
define %struct.op* @findcase(%struct.op* %0, i8* %1) {
%3 = alloca %struct.op*
%4 = alloca i8*
%5 = alloca %struct.op**
store %struct.op* %0, %struct.op** %3
store i8* %1, i8** %4
%6 = load %struct.op*, %struct.op** %3
%7 = load i8*, i8** %4
%8 = call i32 (%struct.op*, i8*, ...) bitcast (i32 (...)* @find1case to i32 (%struct.op*, i8*, ...)*)(%struct.op* %6, i8* %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to %struct.op**
store %struct.op** %10, %struct.op*** %5
%11 = icmp ne %struct.op** %10, null
br i1 %11, label %12, label %15
12: ; preds = %2
%13 = load %struct.op**, %struct.op*** %5
%14 = load %struct.op*, %struct.op** %13
br label %16
15: ; preds = %2
br label %16
16: ; preds = %15, %12
%17 = phi %struct.op* [ %14, %12 ], [ null, %15 ]
ret %struct.op* %17
}

LLVM IR (-O2):
%struct.op = type opaque
define %struct.op* @findcase(%struct.op* %0, i8* %1) {
%3 = tail call i32 (%struct.op*, i8*, ...) bitcast (i32 (...)* @find1case to i32 (%struct.op*, i8*, ...)*)(%struct.op* %0, i8* %1)
%4 = icmp eq i32 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = sext i32 %3 to i64
%7 = inttoptr i64 %6 to %struct.op**
%8 = load %struct.op*, %struct.op** %7
br label %9
9: ; preds = %2, %5
%10 = phi %struct.op* [ %8, %5 ], [ null, %2 ]
ret %struct.op* %10
}
/* Variables and functions */
scalar_t__ findchan_by_dname(char *);
int script_channel_valid(char *channel_name) {
  return findchan_by_dname(channel_name) ? 1 : 0;
}


x86 assembly (clang, -O0):
<script_channel_valid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <findchan_by_dname@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):
<script_channel_valid>:
push   %rax
call   1030 <findchan_by_dname@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @script_channel_valid(i8* %0) {
%2 = tail call i64 @findchan_by_dname(i8* %0)
%3 = icmp ne i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
int xatoi(s)
char *s;
{
  register int i = 0;
  while (*s)
    if (isdigit(*s))
      i = 10 * i + *s++ - '0';
    else
      return (-1);
  return i;
}


x86 assembly (clang, -O0):
<xatoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1179 <xatoi+0x69>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1168 <xatoi+0x58>
imul   $0xa,-0x14(%rbp),%eax
mov    -0x10(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x10(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x14(%rbp)
jmp    1174 <xatoi+0x64>
movl   $0xffffffff,-0x4(%rbp)
jmp    117f <xatoi+0x6f>
jmp    1123 <xatoi+0x13>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xatoi>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <xatoi+0x2d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    $0xffffffd0,%ecx
cmp    $0x9,%ecx
ja     1130 <xatoi+0x30>
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <xatoi+0x10>
ret
xor    %eax,%eax
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @xatoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %15, %11 ], [ %2, %1 ]
%6 = phi i32 [ %14, %11 ], [ 0, %1 ]
%7 = phi i8* [ %13, %11 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = add nsw i32 %8, -48
%10 = icmp ult i32 %9, 10
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = mul nsw i32 %6, 10
%13 = getelementptr inbounds i8, i8* %7, i64 1
%14 = add i32 %9, %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4, %11, %1
%18 = phi i32 [ 0, %1 ], [ %14, %11 ], [ -1, %4 ]
ret i32 %18
}
int fun1176() { return 1176; }


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

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

LLVM IR (-O0):
define i32 @fun1176() {
ret i32 1176
}

LLVM IR (-O2):
define i32 @fun1176() {
ret i32 1176
}
/* Type definitions */
struct timeval {
  scalar_t__ tv_usec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int, int);
int main(void) {
  struct timeval tim;
  gettimeofday(&tim, NULL);
  printf("%d.%06d\n", (int)(tim.tv_sec), (int)(tim.tv_usec));
  return EXIT_SUCCESS;
}


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

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1040 <gettimeofday@plt>
mov    0x8(%rsp),%edx
mov    0x10(%rsp),%esi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
@.str = [9 x i8] c"%d.%06d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
store i32 0, i32* %1
%3 = call i32 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
@.str = [9 x i8] c"%d.%06d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%8 = load i64, i64* %7
%9 = trunc i64 %8 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %9)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}
void _debug_print_backtrace() {}


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

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

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

LLVM IR (-O2):
define void @_debug_print_backtrace() {
ret void
}
c_roopen__(bb) char bb[];
{ return (open(bb, 0)); }


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

x86 assembly (clang, -O2):
<c_roopen__>:
xor    %esi,%esi
xor    %eax,%eax
jmp    1030 <open@plt>

LLVM IR (-O0):
define i32 @c_roopen__(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @open to i32 (i8*, i32, ...)*)(i8* %3, i32 0)
ret i32 %4
}

LLVM IR (-O2):
define i32 @c_roopen__(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @open to i32 (i8*, i32, ...)*)(i8* %0, i32 0)
ret i32 %2
}
/* Variables and functions */
int exp(double);
double sigmoid_element(double element) { return 1 / (1 + exp(-element)); }


x86 assembly (clang, -O0):
<sigmoid_element>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
mov    %eax,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigmoid_element>:
push   %rax
xorps  0xee8(%rip),%xmm0
call   1030 <exp@plt>
lea    0x1(%rax),%ecx
add    $0x2,%eax
xor    %edx,%edx
cmp    $0x3,%eax
cmovb  %ecx,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sigmoid_element(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fneg double %3
%5 = call i32 @exp(double %4)
%6 = add nsw i32 1, %5
%7 = sdiv i32 1, %6
%8 = sitofp i32 %7 to double
ret double %8
}

LLVM IR (-O2):
define double @sigmoid_element(double %0) {
%2 = fneg double %0
%3 = tail call i32 @exp(double %2)
%4 = add nsw i32 %3, 1
%5 = add i32 %3, 2
%6 = icmp ult i32 %5, 3
%7 = select i1 %6, i32 %4, i32 0
%8 = sitofp i32 %7 to double
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ is_prime(int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  scanf("%d", &n);
  is_prime(n);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @is_prime(i32 %4)
ret i32 0
}
void g_filename_to_utf8() {}


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

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

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

LLVM IR (-O2):
define void @g_filename_to_utf8() {
ret void
}
void bar(int **p, int *q) {
  **p = *q++;
  *(*p++)++;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
mov    (%rsi),%eax
mov    (%rdi),%rcx
mov    %eax,(%rcx)
add    $0x4,%rcx
mov    %rcx,(%rdi)
ret

LLVM IR (-O0):
define void @bar(i32** %0, i32* %1) {
%3 = alloca i32**
%4 = alloca i32*
store i32** %0, i32*** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i32 1
store i32* %6, i32** %4
%7 = load i32, i32* %5
%8 = load i32**, i32*** %3
%9 = load i32*, i32** %8
store i32 %7, i32* %9
%10 = load i32**, i32*** %3
%11 = getelementptr inbounds i32*, i32** %10, i32 1
store i32** %11, i32*** %3
%12 = load i32*, i32** %10
%13 = getelementptr inbounds i32, i32* %12, i32 1
store i32* %13, i32** %10
%14 = load i32, i32* %12
ret void
}

LLVM IR (-O2):
define void @bar(i32** nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32*, i32** %0
store i32 %3, i32* %4
%5 = getelementptr inbounds i32, i32* %4, i64 1
store i32* %5, i32** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char fmt[12];
  int i = 10;
  scanf("%s", fmt);
  printf(fmt, i);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0x4(%rsp),%rbx
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = getelementptr inbounds [12 x i8], [12 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @printf(i8* %2, i32 10)
ret i32 0
}
/* Type definitions */
struct fntfile_hdr {
  int dummy;
};

/* Variables and functions */
int get_width(struct fntfile_hdr *, int /*<<< orphan*/);
int /*<<< orphan*/ iso8859_to_atari(int);
void font_gen_width_table(struct fntfile_hdr *fnt, signed int *dst_wtab) {
  int i;
  for (i = 0; i < 256; i++)
    dst_wtab[i] = get_width(fnt, iso8859_to_atari(i));
}


x86 assembly (clang, -O0):
<font_gen_width_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jge    117a <font_gen_width_table+0x5a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <iso8859_to_atari@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
call   1040 <get_width@plt>
mov    %eax,%edx
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <font_gen_width_table+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<font_gen_width_table>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   (%rax)
mov    %ebx,%edi
call   1030 <iso8859_to_atari@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1040 <get_width@plt>
mov    %eax,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    $0x100,%rbx
jne    1130 <font_gen_width_table+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.fntfile_hdr = type { i32 }
define void @font_gen_width_table(%struct.fntfile_hdr* %0, i32* %1) {
%3 = alloca %struct.fntfile_hdr*
%4 = alloca i32*
%5 = alloca i32
store %struct.fntfile_hdr* %0, %struct.fntfile_hdr** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 256
br i1 %8, label %9, label %21
9: ; preds = %6
%10 = load %struct.fntfile_hdr*, %struct.fntfile_hdr** %3
%11 = load i32, i32* %5
%12 = call i32 @iso8859_to_atari(i32 %11)
%13 = call i32 @get_width(%struct.fntfile_hdr* %10, i32 %12)
%14 = load i32*, i32** %4
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 %13, i32* %17
br label %18
18: ; preds = %9
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
%struct.fntfile_hdr = type { i32 }
define void @font_gen_width_table(%struct.fntfile_hdr* %0, i32* nocapture writeonly %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i64 [ 0, %2 ], [ %9, %3 ]
%5 = trunc i64 %4 to i32
%6 = tail call i32 @iso8859_to_atari(i32 %5)
%7 = tail call i32 @get_width(%struct.fntfile_hdr* %0, i32 %6)
%8 = getelementptr inbounds i32, i32* %1, i64 %4
store i32 %7, i32* %8
%9 = add nuw nsw i64 %4, 1
%10 = icmp eq i64 %9, 256
br i1 %10, label %11, label %3
11: ; preds = %3
ret void
}
double dot3(const int *g, double x, double y, double z) {
  return g[0] * x + g[1] * y + g[2] * z;
}


x86 assembly (clang, -O0):
<dot3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdl (%rax),%xmm1
movsd  -0x10(%rbp),%xmm2
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x4(%rax),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
cvtsi2sdl 0x8(%rax),%xmm0
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dot3>:
cvtsi2sdl (%rdi),%xmm3
cvtsi2sdl 0x4(%rdi),%xmm4
mulsd  %xmm1,%xmm4
mulsd  %xmm3,%xmm0
addsd  %xmm4,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x8(%rdi),%xmm1
mulsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @dot3(i32* %0, double %1, double %2, double %3) {
%5 = alloca i32*
%6 = alloca double
%7 = alloca double
%8 = alloca double
store i32* %0, i32** %5
store double %1, double* %6
store double %2, double* %7
store double %3, double* %8
%9 = load i32*, i32** %5
%10 = getelementptr inbounds i32, i32* %9, i64 0
%11 = load i32, i32* %10
%12 = sitofp i32 %11 to double
%13 = load double, double* %6
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = sitofp i32 %16 to double
%18 = load double, double* %7
%19 = fmul double %17, %18
%20 = call double @llvm.fmuladd.f64(double %12, double %13, double %19)
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 2
%23 = load i32, i32* %22
%24 = sitofp i32 %23 to double
%25 = load double, double* %8
%26 = call double @llvm.fmuladd.f64(double %24, double %25, double %20)
ret double %26
}

LLVM IR (-O2):
define double @dot3(i32* nocapture %0, double %1, double %2, double %3) {
%5 = load i32, i32* %0
%6 = sitofp i32 %5 to double
%7 = getelementptr inbounds i32, i32* %0, i64 1
%8 = load i32, i32* %7
%9 = sitofp i32 %8 to double
%10 = fmul double %9, %2
%11 = tail call double @llvm.fmuladd.f64(double %6, double %1, double %10)
%12 = getelementptr inbounds i32, i32* %0, i64 2
%13 = load i32, i32* %12
%14 = sitofp i32 %13 to double
%15 = tail call double @llvm.fmuladd.f64(double %14, double %3, double %11)
ret double %15
}
/* Variables and functions */
int /*<<< orphan*/ bar();
int /*<<< orphan*/ printf(char *);
void foo(void) {
  bar();
  printf("hello foo\n");
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bar@plt>
lea    0xece(%rip),%rdi
call   1040 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rax
xor    %eax,%eax
call   1040 <bar@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"hello foo\0A\00"
define void @foo() {
%1 = call i32 (...) @bar()
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [10 x i8] c"hello foo\00"
define void @foo() {
%1 = tail call i32 (...) @bar()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
ret void
}