xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ hrt(double, double, char *);
int /*<<< orphan*/ printf(char *, double, double);
void print_five(double x, double y) {
  printf("        <rect x=\"%.2fin\" y=\"%.2fin\" width=\"5.75in\" "
         "height=\"0.5in\" fill=\"#0000e0\" />\n",
         x, y + 0.5);
  hrt(x, y, "5");
}


x86 assembly (clang, -O0):
<print_five>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xec1(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
lea    0xebd(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xefc(%rip),%rdi
call   1030 <hrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_five>:
sub    $0x18,%rsp
movapd %xmm1,%xmm2
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
movsd  0xec4(%rip),%xmm1
addsd  %xmm2,%xmm1
lea    0xec1(%rip),%rdi
call   1040 <printf@plt>
lea    0xf0a(%rip),%rdi
movsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
add    $0x18,%rsp
jmp    1030 <hrt@plt>

LLVM IR (-O0):
@.str = [85 x i8] c" <rect x=\22%.2fin\22 y=\22%.2fin\22 width=\225.75in\22 height=\220.5in\22 fill=\22e0\22 />\0A\00"
@.str.1 = [2 x i8] c"5\00"
define void @print_five(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %6, 5.000000e-01
%8 = call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), double %5, double %7)
%9 = load double, double* %3
%10 = load double, double* %4
%11 = call i32 @hrt(double %9, double %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [85 x i8] c" <rect x=\22%.2fin\22 y=\22%.2fin\22 width=\225.75in\22 height=\220.5in\22 fill=\22e0\22 />\0A\00"
@.str.1 = [2 x i8] c"5\00"
define void @print_five(double %0, double %1) {
%3 = fadd double %1, 5.000000e-01
%4 = tail call i32 @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str, i64 0, i64 0), double %0, double %3)
%5 = tail call i32 @hrt(double %0, double %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned char todecimal(unsigned char c) {
  if ((c >= '0') && (c < '9' + 1))
    return (c - '0');
  return 0;
}


x86 assembly (clang, -O0):
<todecimal>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x30,%eax
jl     1133 <todecimal+0x33>
movzbl -0x2(%rbp),%eax
cmp    $0x3a,%eax
jge    1133 <todecimal+0x33>
movzbl -0x2(%rbp),%eax
sub    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    1137 <todecimal+0x37>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<todecimal>:
add    $0xd0,%dil
xor    %ecx,%ecx
cmp    $0xa,%dil
movzbl %dil,%eax
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @todecimal(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp sge i32 %5, 48
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp slt i32 %9, 58
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = sub nsw i32 %13, 48
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %17
16: ; preds = %7, %1
store i8 0, i8* %2
br label %17
17: ; preds = %16, %11
%18 = load i8, i8* %2
ret i8 %18
}

LLVM IR (-O2):
define zeroext i8 @todecimal(i8 zeroext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = select i1 %3, i8 %2, i8 0
ret i8 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ u_int16_t;

/* Variables and functions */
int /*<<< orphan*/ htons(int /*<<< orphan*/);
u_int16_t store_swp_hton16(u_int16_t v) { return htons(v); }


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

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

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

LLVM IR (-O2):
define i32 @store_swp_hton16(i32 %0) {
%2 = tail call i32 @htons(i32 %0)
ret i32 %2
}
void ADC_DelSig_1_ISR1(void) {}


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

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

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

LLVM IR (-O2):
define void @ADC_DelSig_1_ISR1() {
ret void
}
int hash(const char *key, int scope) {
  int i, temp;
  temp = scope + 100;
  for (i = 0; key[i] != '\0'; ++i)
    temp = ((temp << (4)) + key[i]) % (211);
  return temp;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115d <hash+0x5d>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    $0xd3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111b <hash+0x1b>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    %esi,%eax
add    $0x64,%eax
mov    (%rdi),%cl
test   %cl,%cl
je     1141 <hash+0x41>
add    $0x1,%rdi
nop
movsbl %cl,%ecx
shl    $0x4,%eax
add    %ecx,%eax
cltq
imul   $0x4da637d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
imul   $0xd3,%ecx,%ecx
sub    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0, i32 %1) {
%3 = add nsw i32 %1, 100
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %18, label %6
6: ; preds = %2, %6
%7 = phi i64 [ %14, %6 ], [ 0, %2 ]
%8 = phi i8 [ %16, %6 ], [ %4, %2 ]
%9 = phi i32 [ %13, %6 ], [ %3, %2 ]
%10 = sext i8 %8 to i32
%11 = shl i32 %9, 4
%12 = add nsw i32 %11, %10
%13 = srem i32 %12, 211
%14 = add nuw nsw i64 %7, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %6
18: ; preds = %6, %2
%19 = phi i32 [ %3, %2 ], [ %13, %6 ]
ret i32 %19
}
void emptyfunc() {}


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

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

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

LLVM IR (-O2):
define void @emptyfunc() {
ret void
}
int r3_path_contains_slug_char(const char *str, unsigned int len) {
  for (unsigned int i = 0; i < len; i++) {
    if (str[i] == '{')
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<r3_path_contains_slug_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jae    1151 <r3_path_contains_slug_char+0x51>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x7b,%eax
jne    113e <r3_path_contains_slug_char+0x3e>
movl   $0x1,-0x4(%rbp)
jmp    1158 <r3_path_contains_slug_char+0x58>
jmp    1143 <r3_path_contains_slug_char+0x43>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <r3_path_contains_slug_char+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<r3_path_contains_slug_char>:
test   %esi,%esi
je     113b <r3_path_contains_slug_char+0x3b>
mov    $0x1,%eax
cmpb   $0x7b,(%rdi)
je     113a <r3_path_contains_slug_char+0x3a>
mov    %esi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rax,%rdx
cmp    %rax,%rcx
je     1132 <r3_path_contains_slug_char+0x32>
lea    0x1(%rdx),%rax
cmpb   $0x7b,(%rdi,%rdx,1)
jne    1120 <r3_path_contains_slug_char+0x20>
xor    %eax,%eax
cmp    %rcx,%rdx
setb   %al
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @r3_path_contains_slug_char(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %19, label %4
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 123
br i1 %7, label %19, label %8
8: ; preds = %4, %11
%9 = phi i64 [ %15, %11 ], [ 1, %4 ]
%10 = icmp eq i64 %9, %5
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = getelementptr inbounds i8, i8* %0, i64 %9
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 123
%15 = add nuw nsw i64 %9, 1
br i1 %14, label %16, label %8
16: ; preds = %8, %11
%17 = icmp ult i64 %9, %5
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %16, %4, %2
%20 = phi i32 [ 0, %2 ], [ 1, %4 ], [ %18, %16 ]
ret i32 %20
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
void testIf() {
  int a;
  int b;
  int *p;
  a = 13;
  b = 23;
  if (a < b) {
    p = &a;
  } else {
    p = &b;
  }
  test(*p == 13);
}


x86 assembly (clang, -O0):
<testIf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xd,-0x4(%rbp)
movl   $0x17,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113f <testIf+0x2f>
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1147 <testIf+0x37>
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xd,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testIf>:
mov    $0x1,%edi
jmp    1030 <test@plt>

LLVM IR (-O0):
define void @testIf() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
store i32 13, i32* %1
store i32 23, i32* %2
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = icmp slt i32 %4, %5
br i1 %6, label %7, label %8
7: ; preds = %0
store i32* %1, i32** %3
br label %9
8: ; preds = %0
store i32* %2, i32** %3
br label %9
9: ; preds = %8, %7
%10 = load i32*, i32** %3
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 13
%13 = zext i1 %12 to i32
%14 = call i32 @test(i32 %13)
ret void
}

LLVM IR (-O2):
define void @testIf() {
%1 = tail call i32 @test(i32 1)
ret void
}
unsigned char get_Qm(unsigned char I_MCS) {
  if (I_MCS < 10)
    return (2);
  else if (I_MCS < 17)
    return (4);
  else
    return (6);
}


x86 assembly (clang, -O0):
<get_Qm>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0xa,%eax
jge    1120 <get_Qm+0x20>
movb   $0x2,-0x1(%rbp)
jmp    113a <get_Qm+0x3a>
movzbl -0x2(%rbp),%eax
cmp    $0x11,%eax
jge    1136 <get_Qm+0x36>
movb   $0x4,-0x1(%rbp)
jmp    113a <get_Qm+0x3a>
movb   $0x6,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_Qm>:
cmp    $0x11,%dil
setae  %al
add    %al,%al
or     $0x4,%al
cmp    $0xa,%dil
movzbl %al,%ecx
mov    $0x2,%eax
cmovae %ecx,%eax
ret

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

LLVM IR (-O2):
define zeroext i8 @get_Qm(i8 zeroext %0) {
%2 = icmp ult i8 %0, 10
%3 = icmp ult i8 %0, 17
%4 = select i1 %3, i8 4, i8 6
%5 = select i1 %2, i8 2, i8 %4
ret i8 %5
}
/* Variables and functions */
int read_data_cmd();
int /*<<< orphan*/ send_ctrl_cmd(int);
unsigned int lcm_compare_id(void) {
  unsigned int id = 0;
  send_ctrl_cmd(0xBF);
  read_data_cmd();
  read_data_cmd();
  read_data_cmd();
  id = read_data_cmd();
  id |= read_data_cmd() << 8;
  read_data_cmd();
  return ((0x8194) == id) ? 1 : 0;
}


x86 assembly (clang, -O0):
<lcm_compare_id>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xbf,%edi
call   1040 <send_ctrl_cmd@plt>
mov    $0x0,%al
call   1030 <read_data_cmd@plt>
mov    $0x0,%al
call   1030 <read_data_cmd@plt>
mov    $0x0,%al
call   1030 <read_data_cmd@plt>
mov    $0x0,%al
call   1030 <read_data_cmd@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <read_data_cmd@plt>
shl    $0x8,%eax
or     -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <read_data_cmd@plt>
mov    -0x4(%rbp),%esi
mov    $0x8194,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcm_compare_id>:
push   %rbp
push   %rbx
push   %rax
mov    $0xbf,%edi
call   1040 <send_ctrl_cmd@plt>
xor    %eax,%eax
call   1030 <read_data_cmd@plt>
xor    %eax,%eax
call   1030 <read_data_cmd@plt>
xor    %eax,%eax
call   1030 <read_data_cmd@plt>
xor    %eax,%eax
call   1030 <read_data_cmd@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <read_data_cmd@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
or     %ebx,%ebp
xor    %eax,%eax
call   1030 <read_data_cmd@plt>
xor    %eax,%eax
cmp    $0x8194,%ebp
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @lcm_compare_id() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @send_ctrl_cmd(i32 191)
%3 = call i32 (...) @read_data_cmd()
%4 = call i32 (...) @read_data_cmd()
%5 = call i32 (...) @read_data_cmd()
%6 = call i32 (...) @read_data_cmd()
store i32 %6, i32* %1
%7 = call i32 (...) @read_data_cmd()
%8 = shl i32 %7, 8
%9 = load i32, i32* %1
%10 = or i32 %9, %8
store i32 %10, i32* %1
%11 = call i32 (...) @read_data_cmd()
%12 = load i32, i32* %1
%13 = icmp eq i32 33172, %12
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 1, i32 0
ret i32 %15
}

LLVM IR (-O2):
define i32 @lcm_compare_id() {
%1 = tail call i32 @send_ctrl_cmd(i32 191)
%2 = tail call i32 (...) @read_data_cmd()
%3 = tail call i32 (...) @read_data_cmd()
%4 = tail call i32 (...) @read_data_cmd()
%5 = tail call i32 (...) @read_data_cmd()
%6 = tail call i32 (...) @read_data_cmd()
%7 = shl i32 %6, 8
%8 = or i32 %7, %5
%9 = tail call i32 (...) @read_data_cmd()
%10 = icmp eq i32 %8, 33172
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
int __setreuid(uid_t effective_uid, uid_t real_uid) {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__setreuid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__setreuid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__setreuid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @ENOSYS
%6 = call i32 @__set_errno(i32 %5)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__setreuid(i32 %0, i32 %1) {
%3 = load i32, i32* @ENOSYS
%4 = tail call i32 @__set_errno(i32 %3)
ret i32 -1
}
void sim_close(struct lm_interface_state *s) {}


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

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

LLVM IR (-O0):
%struct.lm_interface_state = type opaque
define void @sim_close(%struct.lm_interface_state* %0) {
%2 = alloca %struct.lm_interface_state*
store %struct.lm_interface_state* %0, %struct.lm_interface_state** %2
ret void
}

LLVM IR (-O2):
%struct.lm_interface_state = type opaque
define void @sim_close(%struct.lm_interface_state* nocapture %0) {
ret void
}
double Dadd(double x, double y) { return x + y; }


x86 assembly (clang, -O0):
<Dadd>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Dadd>:
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Dadd(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fadd double %5, %6
ret double %7
}

LLVM IR (-O2):
define double @Dadd(double %0, double %1) {
%3 = fadd double %0, %1
ret double %3
}
/* Variables and functions */
int _cd_chdir(int *, char *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
char *getenv(char *);
int /*<<< orphan*/ stderr;
int _cd_home(void) {
  char *home;
  int prefs = 0;
  if ((home = getenv("HOME")) == NULL) {
    fputs("sh: cd: $HOME is not set\n", stderr);
    return 125;
  }
  return _cd_chdir(&prefs, home);
}


x86 assembly (clang, -O0):
<_cd_home>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x14(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    117a <_cd_home+0x4a>
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1040 <fputs@plt>
movl   $0x7d,-0x4(%rbp)
jmp    118a <_cd_home+0x5a>
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdi
call   1050 <_cd_chdir@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_cd_home>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xec0(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1159 <_cd_home+0x29>
lea    0x4(%rsp),%rdi
mov    %rax,%rsi
call   1050 <_cd_chdir@plt>
pop    %rcx
ret
mov    0x2e80(%rip),%rax
mov    (%rax),%esi
lea    0xe9c(%rip),%rdi
call   1040 <fputs@plt>
mov    $0x7d,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [26 x i8] c"sh: cd: $HOME is not set\0A\00"
@stderr = global i32 0
define i32 @_cd_home() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
store i32 0, i32* %3
%4 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %2
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* @stderr
%8 = call i32 @fputs(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %7)
store i32 125, i32* %1
br label %12
9: ; preds = %0
%10 = load i8*, i8** %2
%11 = call i32 @_cd_chdir(i32* %3, i8* %10)
store i32 %11, i32* %1
br label %12
12: ; preds = %9, %6
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [26 x i8] c"sh: cd: $HOME is not set\0A\00"
@stderr = global i32 0
define i32 @_cd_home() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = load i32, i32* @stderr
%7 = tail call i32 @fputs(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %10
8: ; preds = %0
%9 = call i32 @_cd_chdir(i32* %1, i8* %3)
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ 125, %5 ], [ %9, %8 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isascii(int);
void t_isascii_0x79() {
  Assert_real((isascii(121)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isascii.c",
              610, ("isascii should be 1 for y"));
}


x86 assembly (clang, -O0):
<t_isascii_0x79>:
push   %rbp
mov    %rsp,%rbp
mov    $0x79,%edi
call   1030 <isascii@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x262,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isascii_0x79>:
lea    0xee9(%rip),%rsi
lea    0xf8a(%rip),%rcx
mov    $0x1,%edi
mov    $0x262,%edx
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for y\00"
define void @t_isascii_0x79() {
%1 = call i32 @isascii(i32 121)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 610, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isascii.c\00"
@.str.1 = [26 x i8] c"isascii should be 1 for y\00"
define void @t_isascii_0x79() {
%1 = tail call i32 @Assert_real(i32 1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 610, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int tray_init(struct tray *tray) { return -1; }


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

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

LLVM IR (-O0):
%struct.tray = type opaque
define i32 @tray_init(%struct.tray* %0) {
%2 = alloca %struct.tray*
store %struct.tray* %0, %struct.tray** %2
ret i32 -1
}

LLVM IR (-O2):
%struct.tray = type opaque
define i32 @tray_init(%struct.tray* nocapture readnone %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void handler(int signo __attribute__((unused))) { printf("Caught SIGCHLD\n"); }


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [16 x i8] c"Caught SIGCHLD\0A\00"
define void @handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [15 x i8] c"Caught SIGCHLD\00"
define void @handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
void comments() {}


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

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

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

LLVM IR (-O2):
define void @comments() {
ret void
}
void msm_jtag_etm_restore_state(void) {}


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

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

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

LLVM IR (-O2):
define void @msm_jtag_etm_restore_state() {
ret void
}
/* Variables and functions */
double randGaussian(double, double);
double GenerateGaussianRandomNumber(double mean, double variance) {
  return randGaussian(mean, variance);
}


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

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

LLVM IR (-O0):
define double @GenerateGaussianRandomNumber(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call double @randGaussian(double %5, double %6)
ret double %7
}

LLVM IR (-O2):
define double @GenerateGaussianRandomNumber(double %0, double %1) {
%3 = tail call double @randGaussian(double %0, double %1)
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ mpz_t;
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ mpz_add(int /*<<< orphan*/, int /*<<< orphan*/,
                           int /*<<< orphan*/);
int /*<<< orphan*/ mpz_clear(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_init(int /*<<< orphan*/);
int /*<<< orphan*/ mpz_set_int64(int /*<<< orphan*/, int /*<<< orphan*/);
void mpz_add_int64(mpz_t z, int64_t x) {
  mpz_t aux;
  mpz_init(aux);
  mpz_set_int64(aux, x);
  mpz_add(z, z, aux);
  mpz_clear(aux);
}


x86 assembly (clang, -O0):
<mpz_add_int64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <mpz_init@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <mpz_set_int64@plt>
mov    -0x4(%rbp),%edi
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1050 <mpz_add@plt>
mov    -0xc(%rbp),%edi
call   1060 <mpz_clear@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mpz_add_int64>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
call   1040 <mpz_init@plt>
mov    %ebx,%esi
call   1030 <mpz_set_int64@plt>
mov    %ebp,%edi
mov    %ebp,%esi
call   1050 <mpz_add@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1060 <mpz_clear@plt>

LLVM IR (-O0):
define void @mpz_add_int64(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %5
%7 = call i32 @mpz_init(i32 %6)
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = call i32 @mpz_set_int64(i32 %8, i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = call i32 @mpz_add(i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* %5
%16 = call i32 @mpz_clear(i32 %15)
ret void
}

LLVM IR (-O2):
define void @mpz_add_int64(i32 %0, i32 %1) {
%3 = tail call i32 @mpz_init(i32 undef)
%4 = tail call i32 @mpz_set_int64(i32 undef, i32 %1)
%5 = tail call i32 @mpz_add(i32 %0, i32 %0, i32 undef)
%6 = tail call i32 @mpz_clear(i32 undef)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DH;
typedef int /*<<< orphan*/ ASN1_VALUE;

/* Variables and functions */
int ASN1_item_i2d(int /*<<< orphan*/ *, unsigned char **, int /*<<< orphan*/ *);
int /*<<< orphan*/ DHparams_it;
int i2d_DHparams(const DH *a, unsigned char **out) {
  return ASN1_item_i2d((ASN1_VALUE *)a, out, &DHparams_it);
}


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

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

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

LLVM IR (-O2):
@DHparams_it = global i32 0
define i32 @i2d_DHparams(i32* %0, i8** %1) {
%3 = tail call i32 @ASN1_item_i2d(i32* %0, i8** %1, i32* @DHparams_it)
ret i32 %3
}
void no_cdx_sth(unsigned short *p, unsigned short x) { p[16] = x; }


x86 assembly (clang, -O0):
<no_cdx_sth>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x8(%rbp),%rax
mov    %cx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<no_cdx_sth>:
mov    %si,0x20(%rdi)
ret

LLVM IR (-O0):
define void @no_cdx_sth(i16* %0, i16 zeroext %1) {
%3 = alloca i16*
%4 = alloca i16
store i16* %0, i16** %3
store i16 %1, i16* %4
%5 = load i16, i16* %4
%6 = load i16*, i16** %3
%7 = getelementptr inbounds i16, i16* %6, i64 16
store i16 %5, i16* %7
ret void
}

LLVM IR (-O2):
define void @no_cdx_sth(i16* nocapture writeonly %0, i16 zeroext %1) {
%3 = getelementptr inbounds i16, i16* %0, i64 16
store i16 %1, i16* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mysql_hash_password(unsigned long *, char const *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned long, unsigned long);
void mysql_make_scrambled_password(char *to, const char *password) {
  unsigned long hash_res[2];
  mysql_hash_password(hash_res, password);
  sprintf(to, "%08lx%08lx", hash_res[0], hash_res[1]);
}


x86 assembly (clang, -O0):
<mysql_make_scrambled_password>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <mysql_hash_password@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xeb0(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysql_make_scrambled_password>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    %rsp,%rdi
call   1030 <mysql_hash_password@plt>
mov    (%rsp),%rdx
mov    0x8(%rsp),%rcx
lea    0xec0(%rip),%rsi
mov    %rbx,%rdi
call   1040 <sprintf@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"%08lx%08lx\00"
define void @mysql_make_scrambled_password(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2 x i64]
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @mysql_hash_password(i64* %6, i8* %7)
%9 = load i8*, i8** %3
%10 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
%11 = load i64, i64* %10
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 1
%13 = load i64, i64* %12
%14 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %11, i64 %13)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%08lx%08lx\00"
define void @mysql_make_scrambled_password(i8* nocapture writeonly %0, i8* %1) {
%3 = alloca [2 x i64]
%4 = bitcast [2 x i64]* %3 to i8*
%5 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
%6 = call i32 @mysql_hash_password(i64* %5, i8* %1)
%7 = load i64, i64* %5
%8 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 1
%9 = load i64, i64* %8
%10 = call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i64 %7, i64 %9)
ret void
}
void sys_iatt_release(struct iatt *src) {}


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

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

LLVM IR (-O0):
%struct.iatt = type opaque
define void @sys_iatt_release(%struct.iatt* %0) {
%2 = alloca %struct.iatt*
store %struct.iatt* %0, %struct.iatt** %2
ret void
}

LLVM IR (-O2):
%struct.iatt = type opaque
define void @sys_iatt_release(%struct.iatt* nocapture %0) {
ret void
}
void __ARM_argv_veneer(void) {}


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

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

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

LLVM IR (-O2):
define void @__ARM_argv_veneer() {
ret void
}
unsigned char io_inb(unsigned short port) {
  unsigned char byte;
  __asm__("mov %1, %%dx\n\t"
          "in %%dx, %%al\n\t"
          "mov %%al, %0\n"
          : "=r"(byte)
          : "r"(port)
          : "%al", "%dx");
  return byte;
}


x86 assembly (clang, -O0):
<io_inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%cx
mov    %cx,%dx
in     (%dx),%al
mov    %al,%cl
mov    %cl,-0x4(%rbp)
mov    -0x4(%rbp),%al
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<io_inb>:
mov    %di,%dx
in     (%dx),%al
mov    %al,%cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define zeroext i8 @io_inb(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm "mov $1, %dx\0A\09in %dx, %al\0A\09mov %al, $0\0A", "=r,r,~{al},~{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define zeroext i8 @io_inb(i16 zeroext %0) {
%2 = tail call i8 asm "mov $1, %dx\0A\09in %dx, %al\0A\09mov %al, $0\0A", "=r,r,~{al},~{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __attribute__((stdcall)) free_export(void *mem) { free(mem); }


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

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

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

LLVM IR (-O2):
define void @free_export(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int read_int(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int read_max_backlight(char *driver) {
  char path[1024];
  sprintf(path, "/sys/class/backlight/%s/max_brightness", driver);
  return read_int(path);
}


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

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

LLVM IR (-O0):
@.str = [39 x i8] c"/sys/class/backlight/%s/max_brightness\00"
define i32 @read_max_backlight(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i32 @read_int(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [39 x i8] c"/sys/class/backlight/%s/max_brightness\00"
define i32 @read_max_backlight(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8* %0)
%5 = call i32 @read_int(i8* %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ IOPi_init(int, int /*<<< orphan*/);
int /*<<< orphan*/ _IONBF;
int /*<<< orphan*/ read_port(int, int);
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/, int /*<<< orphan*/ *,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int main(int argc, char **argv) {
  setvbuf(stdout, NULL, _IONBF, 0);
  IOPi_init(0x20, 0);
  read_port(0x20, 0);
  read_port(0x20, 1);
  (void)argc;
  (void)argv;
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
mov    0x2e92(%rip),%rax
mov    (%rax),%edx
xor    %eax,%eax
mov    %eax,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1050 <IOPi_init@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <read_port@plt>
mov    $0x20,%edi
mov    $0x1,%esi
call   1030 <read_port@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
xor    %ecx,%ecx
call   1040 <setvbuf@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1050 <IOPi_init@plt>
mov    $0x20,%edi
xor    %esi,%esi
call   1030 <read_port@plt>
mov    $0x20,%edi
mov    $0x1,%esi
call   1030 <read_port@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
@_IONBF = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* @stdout
%7 = load i32, i32* @_IONBF
%8 = call i32 @setvbuf(i32 %6, i32* null, i32 %7, i32 0)
%9 = call i32 @IOPi_init(i32 32, i32 0)
%10 = call i32 @read_port(i32 32, i32 0)
%11 = call i32 @read_port(i32 32, i32 1)
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
@_IONBF = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @stdout
%4 = load i32, i32* @_IONBF
%5 = tail call i32 @setvbuf(i32 %3, i32* null, i32 %4, i32 0)
%6 = tail call i32 @IOPi_init(i32 32, i32 0)
%7 = tail call i32 @read_port(i32 32, i32 0)
%8 = tail call i32 @read_port(i32 32, i32 1)
ret i32 0
}
void queue_release(struct queue *p_queue) {
  if (!p_queue) {
    printf("%s line:%dCan't release! You passed NULL into queue_release()\n",
           __FUNCTION__, 14);
    return;
  }
  free(p_queue);
}


x86 assembly (clang, -O0):
<queue_release>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <queue_release+0x36>
lea    0xec2(%rip),%rdi
lea    0xefa(%rip),%rsi
mov    $0xe,%edx
mov    $0x0,%al
call   1040 <printf@plt>
jmp    115f <queue_release+0x3f>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<queue_release>:
test   %rdi,%rdi
je     112a <queue_release+0xa>
jmp    1030 <free@plt>
lea    0xecf(%rip),%rdi
lea    0xf07(%rip),%rsi
mov    $0xe,%edx
xor    %eax,%eax
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.queue = type opaque
@.str = [63 x i8] c"%s line:%dCan't release! You passed NULL into queue_release()\0A\00"
@__FUNCTION__.queue_release = [14 x i8] c"queue_release\00"
define void @queue_release(%struct.queue* %0) {
%2 = alloca %struct.queue*
store %struct.queue* %0, %struct.queue** %2
%3 = load %struct.queue*, %struct.queue** %2
%4 = icmp ne %struct.queue* %3, null
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.queue_release, i64 0, i64 0), i32 14)
br label %10
7: ; preds = %1
%8 = load %struct.queue*, %struct.queue** %2
%9 = bitcast %struct.queue* %8 to i8*
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
%struct.queue = type opaque
@.str = [63 x i8] c"%s line:%dCan't release! You passed NULL into queue_release()\0A\00"
@__FUNCTION__.queue_release = [14 x i8] c"queue_release\00"
define void @queue_release(%struct.queue* %0) {
%2 = icmp eq %struct.queue* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @__FUNCTION__.queue_release, i64 0, i64 0), i32 14)
br label %7
5: ; preds = %1
%6 = bitcast %struct.queue* %0 to i8*
tail call void @free(i8* %6)
br label %7
7: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int num_devs = 0, i;
  for (i = 0; i < num_devs; i++) {
#pragma offload target(mic : i)
    printf("Hello from MIC %d!\n", i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1156 <main+0x46>
mov    -0xc(%rbp),%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef long long uint64_t;
typedef long long int64_t;

/* Variables and functions */
long long abs64(long long);
void hazer_format_nanominutes2degrees(int64_t nanominutes, int *degreesp,
                                      uint64_t *tenmillionthsp) {
  *degreesp = nanominutes / 60000000000LL;
  nanominutes = abs64(nanominutes);
  nanominutes = nanominutes % 60000000000LL;
  *tenmillionthsp = nanominutes / 6000ULL;
}


x86 assembly (clang, -O0):
<hazer_format_nanominutes2degrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movabs $0xdf8475800,%rcx
cqto
idiv   %rcx
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <abs64@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movabs $0xdf8475800,%rcx
cqto
idiv   %rcx
mov    %rdx,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x1770,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hazer_format_nanominutes2degrees>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
movabs $0x12533fe68fd3d1d,%rbx
33 25 01
mov    %rdi,%rax
imul   %rbx
mov    %rdx,%rax
shr    $0x3f,%rax
shr    $0x1c,%rdx
add    %eax,%edx
mov    %edx,(%rsi)
call   1030 <abs64@plt>
mov    %rax,%rcx
imul   %rbx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x1c,%rdx
add    %rax,%rdx
movabs $0xdf8475800,%rax
imul   %rdx,%rax
sub    %rax,%rcx
movabs $0xaec33e1f671529a5,%rdx
3e c3 ae
mov    %rcx,%rax
mul    %rdx
shr    $0xc,%rdx
mov    %rdx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @hazer_format_nanominutes2degrees(i64 %0, i32* %1, i64* %2) {
%4 = alloca i64
%5 = alloca i32*
%6 = alloca i64*
store i64 %0, i64* %4
store i32* %1, i32** %5
store i64* %2, i64** %6
%7 = load i64, i64* %4
%8 = sdiv i64 %7, 60000000000
%9 = trunc i64 %8 to i32
%10 = load i32*, i32** %5
store i32 %9, i32* %10
%11 = load i64, i64* %4
%12 = call i64 @abs64(i64 %11)
store i64 %12, i64* %4
%13 = load i64, i64* %4
%14 = srem i64 %13, 60000000000
store i64 %14, i64* %4
%15 = load i64, i64* %4
%16 = udiv i64 %15, 6000
%17 = load i64*, i64** %6
store i64 %16, i64* %17
ret void
}

LLVM IR (-O2):
define void @hazer_format_nanominutes2degrees(i64 %0, i32* nocapture writeonly %1, i64* nocapture writeonly %2) {
%4 = sdiv i64 %0, 60000000000
%5 = trunc i64 %4 to i32
store i32 %5, i32* %1
%6 = tail call i64 @abs64(i64 %0)
%7 = srem i64 %6, 60000000000
%8 = udiv i64 %7, 6000
store i64 %8, i64* %2
ret void
}
int base1() { return 3; }


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

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

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

LLVM IR (-O2):
define i32 @base1() {
ret i32 3
}
void gl2psPrintPGFFinalPrimitive(void) {}


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

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

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

LLVM IR (-O2):
define void @gl2psPrintPGFFinalPrimitive() {
ret void
}
int Q_toupper(int c) {
  if (((c) >= 'a' && (c) <= 'z')) {
    c -= ('a' - 'A');
  }
  return c;
}


x86 assembly (clang, -O0):
<Q_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x61,-0x4(%rbp)
jl     1124 <Q_toupper+0x24>
cmpl   $0x7a,-0x4(%rbp)
jg     1124 <Q_toupper+0x24>
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Q_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Variables and functions */
char *complement(char *);
int /*<<< orphan*/ free(char *);
char *reverse(char *);
char *reverseComplement(char *string) {
  char *complementString = complement(string);
  char *reverseComplement = reverse(complementString);
  free(complementString);
  return reverseComplement;
}


x86 assembly (clang, -O0):
<reverseComplement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <complement@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <reverse@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverseComplement>:
push   %r14
push   %rbx
push   %rax
call   1050 <complement@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <reverse@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @reverseComplement(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i8* @complement(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %3
%8 = call i8* @reverse(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = call i32 @free(i8* %9)
%11 = load i8*, i8** %4
ret i8* %11
}

LLVM IR (-O2):
define i8* @reverseComplement(i8* %0) {
%2 = tail call i8* @complement(i8* %0)
%3 = tail call i8* @reverse(i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i8* %3
}