xunge/DecIR huggingface dataset:
int two_bytes_to_signed_int(unsigned char low_byte, unsigned char high_byte) {
  int num;
  if (high_byte > 127)
    num = (-256 * (high_byte - 128)) - low_byte;
  else
    num = 256 * high_byte + low_byte;
  return (num);
}


x86 assembly (clang, -O0):
<two_bytes_to_signed_int>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x7f,%eax
jle    113a <two_bytes_to_signed_int+0x3a>
movzbl -0x2(%rbp),%eax
sub    $0x80,%eax
imul   $0xffffff00,%eax,%eax
movzbl -0x1(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    114a <two_bytes_to_signed_int+0x4a>
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<two_bytes_to_signed_int>:
test   %sil,%sil
js     110f <two_bytes_to_signed_int+0xf>
shl    $0x8,%esi
movzbl %dil,%eax
or     %esi,%eax
ret
shl    $0x8,%esi
movzbl %dil,%ecx
or     %esi,%ecx
mov    $0x8000,%eax
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @two_bytes_to_signed_int(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = icmp slt i8 %1, 0
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = mul nsw i32 %3, -256
%7 = zext i8 %0 to i32
%8 = sub nuw nsw i32 32768, %7
%9 = add nsw i32 %8, %6
br label %14
10: ; preds = %2
%11 = shl nuw nsw i32 %3, 8
%12 = zext i8 %0 to i32
%13 = or i32 %11, %12
br label %14
14: ; preds = %10, %5
%15 = phi i32 [ %9, %5 ], [ %13, %10 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ cpuid(int *, int);
int has_avx2(void) {
  int info[4];
  cpuid(info, 0x00000007);
  return ((info[1] & ((int)1 << 5)) != 0);
}


x86 assembly (clang, -O0):
<has_avx2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
mov    $0x7,%esi
call   1030 <cpuid@plt>
mov    -0xc(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<has_avx2>:
sub    $0x18,%rsp
mov    %rsp,%rdi
mov    $0x7,%esi
call   1030 <cpuid@plt>
mov    0x4(%rsp),%eax
shr    $0x5,%eax
and    $0x1,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @has_avx2() {
%1 = alloca [4 x i32]
%2 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%3 = call i32 @cpuid(i32* %2, i32 7)
%4 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
%5 = load i32, i32* %4
%6 = and i32 %5, 32
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @has_avx2() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 @cpuid(i32* %3, i32 7)
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 1
%6 = load i32, i32* %5
%7 = lshr i32 %6, 5
%8 = and i32 %7, 1
ret i32 %8
}
unsigned SetGreen(const unsigned int color, const unsigned int green) {
  return ((color & 0xFFFF00FF) | (green << 8));
}


x86 assembly (clang, -O0):
<SetGreen>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff00ff,%eax
mov    -0x8(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetGreen>:
mov    %esi,%eax
and    $0xffff00ff,%edi
shl    $0x8,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @SetGreen(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 = and i32 %5, -65281
%7 = load i32, i32* %4
%8 = shl i32 %7, 8
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @SetGreen(i32 %0, i32 %1) {
%3 = and i32 %0, -65281
%4 = shl i32 %1, 8
%5 = or i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ val;
typedef scalar_t__ uint16_t;
struct blob_buf {
  int dummy;
};
struct blob_attr {
  int dummy;
};

/* Variables and functions */
scalar_t__ __u_bswap16(scalar_t__);
struct blob_attr *blob_put(struct blob_buf *, int, scalar_t__ *, int);
struct blob_attr *blob_put_u16(struct blob_buf *buf, int id, uint16_t val) {
  val = __u_bswap16((uint16_t)(val));
  return blob_put(buf, id, &val, sizeof(val));
}


x86 assembly (clang, -O0):
<blob_put_u16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <__u_bswap16@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x18(%rbp),%rdx
mov    $0x8,%ecx
call   1040 <blob_put@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blob_put_u16>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1030 <__u_bswap16@plt>
mov    %rax,(%rsp)
mov    %rsp,%rdx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x8,%ecx
call   1040 <blob_put@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.blob_attr = type { i32 }
%struct.blob_buf = type { i32 }
define %struct.blob_attr* @blob_put_u16(%struct.blob_buf* %0, i32 %1, i64 %2) {
%4 = alloca %struct.blob_buf*
%5 = alloca i32
%6 = alloca i64
store %struct.blob_buf* %0, %struct.blob_buf** %4
store i32 %1, i32* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = call i64 @__u_bswap16(i64 %7)
store i64 %8, i64* %6
%9 = load %struct.blob_buf*, %struct.blob_buf** %4
%10 = load i32, i32* %5
%11 = call %struct.blob_attr* @blob_put(%struct.blob_buf* %9, i32 %10, i64* %6, i32 8)
ret %struct.blob_attr* %11
}

LLVM IR (-O2):
%struct.blob_attr = type { i32 }
%struct.blob_buf = type { i32 }
define %struct.blob_attr* @blob_put_u16(%struct.blob_buf* %0, i32 %1, i64 %2) {
%4 = alloca i64
%5 = tail call i64 @__u_bswap16(i64 %2)
store i64 %5, i64* %4
%6 = call %struct.blob_attr* @blob_put(%struct.blob_buf* %0, i32 %1, i64* %4, i32 8)
ret %struct.blob_attr* %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
void WriteRTFPostamble(FILE *f) { fputs("}\r\n", f); }


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

x86 assembly (clang, -O2):
<WriteRTFPostamble>:
mov    %rdi,%rcx
lea    0xee6(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
jmp    1030 <fwrite@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"}\0D\0A\00"
define void @WriteRTFPostamble(i32* nocapture %0) {
%2 = tail call i64 @fwrite(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 3, i64 1, i32* %0)
ret void
}
unsigned int grpci2_tw(unsigned int data) {
  return ((data & 0xff) << 24) | (((data >> 8) & 0xff) << 16) |
         (((data >> 16) & 0xff) << 8) | (((data >> 24) & 0xff));
}


x86 assembly (clang, -O0):
<grpci2_tw>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x4(%rbp),%ecx
shr    $0x8,%ecx
and    $0xff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x10,%ecx
and    $0xff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x4(%rbp),%ecx
shr    $0x18,%ecx
and    $0xff,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @grpci2_tw(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 255
%5 = shl i32 %4, 24
%6 = load i32, i32* %2
%7 = lshr i32 %6, 8
%8 = and i32 %7, 255
%9 = shl i32 %8, 16
%10 = or i32 %5, %9
%11 = load i32, i32* %2
%12 = lshr i32 %11, 16
%13 = and i32 %12, 255
%14 = shl i32 %13, 8
%15 = or i32 %10, %14
%16 = load i32, i32* %2
%17 = lshr i32 %16, 24
%18 = and i32 %17, 255
%19 = or i32 %15, %18
ret i32 %19
}

LLVM IR (-O2):
define i32 @grpci2_tw(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
int mySubFunc(int a1, int a2) { return (a1 - a2); }


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

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

LLVM IR (-O0):
define i32 @mySubFunc(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @mySubFunc(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int getchar();
int /*<<< orphan*/ printf(char *, int);
main(void) {
  int c;
  int nc = 0;
  while ((c = getchar()) != '\n') {
    ++nc;
  }
  printf("\nNúmero de caractere:%d\n", nc);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xa,%eax
je     1157 <main+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <main+0x16>
mov    -0xc(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getchar@plt>
add    $0x1,%ebx
cmp    $0xa,%eax
jne    1130 <main+0x10>
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [26 x i8] c"\0AN\C3\BAmero de caractere:%d\0A\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %5, %1 ]
%3 = tail call i32 (...) @getchar()
%4 = icmp eq i32 %3, 10
%5 = add nuw nsw i32 %2, 1
br i1 %4, label %6, label %1
6: ; preds = %1
%7 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}
int false_test(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @false_test() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: wrapsrv <SRVNAME> <COMMAND> [OPTION]...\n");
  fprintf(stderr, "%%h and %%p sequences will be converted to "
                  "hostname and port.\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xee7(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xef1(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: wrapsrv <SRVNAME> <COMMAND> [OPTION]...\0A\00"
@.str.1 = [63 x i8] c"%%h and %%p sequences will be converted to hostname and port.\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = call i32 @exit(i32 %5)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [48 x i8] c"Usage: wrapsrv <SRVNAME> <COMMAND> [OPTION]...\0A\00"
@.str.1 = [63 x i8] c"%%h and %%p sequences will be converted to hostname and port.\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
struct inv_icm30xxx {
  int dummy;
};

/* Variables and functions */
int inv_icm30xxx_write_reg(struct inv_icm30xxx *, int /*<<< orphan*/,
                           int /*<<< orphan*/, int /*<<< orphan*/ *, int);
int inv_icm30xxx_write_reg_one(struct inv_icm30xxx *s, uint8_t bank,
                               uint8_t reg, uint8_t reg_value) {
  return inv_icm30xxx_write_reg(s, bank, reg, &reg_value, 1);
}


x86 assembly (clang, -O0):
<inv_icm30xxx_write_reg_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x14(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <inv_icm30xxx_write_reg@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_icm30xxx_write_reg_one>:
push   %rax
mov    %ecx,0x4(%rsp)
lea    0x4(%rsp),%rcx
mov    $0x1,%r8d
call   1030 <inv_icm30xxx_write_reg@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.inv_icm30xxx = type { i32 }
define i32 @inv_icm30xxx_write_reg_one(%struct.inv_icm30xxx* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca %struct.inv_icm30xxx*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.inv_icm30xxx* %0, %struct.inv_icm30xxx** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load %struct.inv_icm30xxx*, %struct.inv_icm30xxx** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 @inv_icm30xxx_write_reg(%struct.inv_icm30xxx* %9, i32 %10, i32 %11, i32* %8, i32 1)
ret i32 %12
}

LLVM IR (-O2):
%struct.inv_icm30xxx = type { i32 }
define i32 @inv_icm30xxx_write_reg_one(%struct.inv_icm30xxx* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
store i32 %3, i32* %5
%6 = call i32 @inv_icm30xxx_write_reg(%struct.inv_icm30xxx* %0, i32 %1, i32 %2, i32* %5, i32 1)
ret i32 %6
}
int HelpItem162(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @HelpItem162() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
void Close(int fd) {
  int rc = close(fd);
  if (rc < 0) {
    perror("Close error");
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<Close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    116a <Close+0x3a>
lea    0xea9(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Close>:
push   %rax
call   1030 <close@plt>
test   %eax,%eax
js     113c <Close+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Close error\00"
@EXIT_FAILURE = global i32 0
define void @Close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @close(i32 %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Close error\00"
@EXIT_FAILURE = global i32 0
define void @Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp slt i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %1
ret void
}
/* Variables and functions */
long ENOTSUP;
int /*<<< orphan*/ __simple_printf(char *, char const *);
int /*<<< orphan*/ sys_exit(int);
long sys_reboot(int opt, const char *cmd) {
  __simple_printf("ALERT: The process has asked for system reboot with cmd "
                  "'%s' - terminating\n",
                  cmd);
  sys_exit(1);
  return -ENOTSUP;
}


x86 assembly (clang, -O0):
<sys_reboot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1040 <__simple_printf@plt>
mov    $0x1,%edi
call   1030 <sys_exit@plt>
xor    %eax,%eax
mov    0x2e96(%rip),%rcx
sub    (%rcx),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_reboot>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <__simple_printf@plt>
mov    $0x1,%edi
call   1030 <sys_exit@plt>
mov    0x2eaa(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [76 x i8] c"ALERT: The process has asked for system reboot with cmd '%s' - terminating\0A\00"
@ENOTSUP = global i64 0
define i64 @sys_reboot(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @__simple_printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 @sys_exit(i32 1)
%8 = load i64, i64* @ENOTSUP
%9 = sub nsw i64 0, %8
ret i64 %9
}

LLVM IR (-O2):
@.str = [76 x i8] c"ALERT: The process has asked for system reboot with cmd '%s' - terminating\0A\00"
@ENOTSUP = global i64 0
define i64 @sys_reboot(i32 %0, i8* %1) {
%3 = tail call i32 @__simple_printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i8* %1)
%4 = tail call i32 @sys_exit(i32 1)
%5 = load i64, i64* @ENOTSUP
%6 = sub nsw i64 0, %5
ret i64 %6
}
/* Variables and functions */
scalar_t__ isspace(char);
char *ltrim(char *s) {
  char *tmp = s;
  while (tmp && isspace(*tmp))
    ++tmp;
  return tmp;
}


x86 assembly (clang, -O0):
<ltrim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     114a <ltrim+0x3a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    115a <ltrim+0x4a>
jmp    116b <ltrim+0x5b>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <ltrim+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltrim>:
push   %rbx
test   %rdi,%rdi
je     1134 <ltrim+0x24>
mov    %rdi,%rbx
add    $0xffffffffffffffff,%rbx
nopl   (%rax)
movsbl 0x1(%rbx),%edi
add    $0x1,%rbx
call   1030 <isspace@plt>
test   %rax,%rax
jne    1120 <ltrim+0x10>
jmp    1136 <ltrim+0x26>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @ltrim(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i8* [ %8, %3 ], [ %0, %1 ]
%5 = load i8, i8* %4
%6 = tail call i64 @isspace(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %7, label %9, label %3
9: ; preds = %3, %1
%10 = phi i8* [ null, %1 ], [ %4, %3 ]
ret i8* %10
}
/* Variables and functions */
extern char *ReturnNullString() { return NULL; }


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

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

LLVM IR (-O0):
define i8* @ReturnNullString() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @ReturnNullString() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_arr(int arr[], int n) {
  int i;
  for (i = 0; i < n; ++i)
    printf("%d ", arr[i]);
  printf("\n");
}


x86 assembly (clang, -O0):
<print_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_arr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_arr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_arr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_arr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_arr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
double *sub3(double *p, int n) { return p - n; }


x86 assembly (clang, -O0):
<sub3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub3>:
mov    %rdi,%rax
movslq %esi,%rcx
shl    $0x3,%rcx
sub    %rcx,%rax
ret

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

LLVM IR (-O2):
define double* @sub3(double* readnone %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = sub nsw i64 0, %3
%5 = getelementptr inbounds double, double* %0, i64 %4
ret double* %5
}
dramfreq_unregister_notifier(struct notifier_block *nb) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.notifier_block = type opaque
define i32 @dramfreq_unregister_notifier(%struct.notifier_block* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int ph_unknown_handle_packet(void *handler, const char *packet, ssize_t len) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ph_unknown_handle_packet(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
char *emalloc(n)
unsigned n;
{
  char *p, *malloc();
  p = malloc(n);
  if (p == 0)
    execerror("out of memory", (char *)0);
  return p;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1156 <emalloc+0x36>
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x0,%al
call   1030 <execerror@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %rbx
xor    %eax,%eax
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1140 <emalloc+0x20>
lea    0xec9(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <execerror@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"out of memory\00"
define i8* @emalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @execerror to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* null)
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [14 x i8] c"out of memory\00"
define i8* @emalloc(i32 %0) {
%2 = tail call i8* (i32, ...) bitcast (i8* (...)* @malloc to i8* (i32, ...)*)(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @execerror to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* null)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ q_sort(int *, int /*<<< orphan*/, int);
void quick_sort(int numbers[], int array_size) {
  q_sort(numbers, 0, array_size - 1);
}


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

x86 assembly (clang, -O2):
<quick_sort>:
lea    -0x1(%rsi),%edx
xor    %esi,%esi
jmp    1030 <q_sort@plt>

LLVM IR (-O0):
define void @quick_sort(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %6, 1
%8 = call i32 @q_sort(i32* %5, i32 0, i32 %7)
ret void
}

LLVM IR (-O2):
define void @quick_sort(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = tail call i32 @q_sort(i32* %0, i32 0, i32 %3)
ret void
}
int potencia2(int p) {
  int i, result;
  result = 1;
  for (i = 0; i < p; i++)
    result = result * 2;
  return result;
}


x86 assembly (clang, -O0):
<potencia2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1138 <potencia2+0x38>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <potencia2+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<potencia2>:
test   %edi,%edi
jle    1118 <potencia2+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <potencia2+0x1e>
mov    $0x1,%eax
jmp    1138 <potencia2+0x38>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <potencia2+0x30>
test   %ecx,%ecx
je     1147 <potencia2+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <potencia2+0x40>
ret

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

LLVM IR (-O2):
define i32 @potencia2(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %25
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %13, %9 ]
%12 = shl i32 %10, 8
%13 = add i32 %11, 8
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i32 [ undef, %3 ], [ %12, %9 ]
%17 = phi i32 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i32 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i32 [ %22, %19 ], [ %17, %15 ]
%21 = phi i32 [ %23, %19 ], [ 0, %15 ]
%22 = shl nsw i32 %20, 1
%23 = add i32 %21, 1
%24 = icmp eq i32 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i32 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i32 %26
}
/* Variables and functions */
int _eml_str_append_n(char **, char *, int);
int _eml_str_append_char(char **to, char c) {
  return _eml_str_append_n(to, &c, 1);
}


x86 assembly (clang, -O0):
<_eml_str_append_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x1,%edx
call   1030 <_eml_str_append_n@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_eml_str_append_char>:
push   %rax
mov    %sil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edx
call   1030 <_eml_str_append_n@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @_eml_str_append_char(i8** %0, i8 signext %1) {
%3 = alloca i8
store i8 %1, i8* %3
%4 = call i32 @_eml_str_append_n(i8** %0, i8* %3, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int strlen(char *);
void printchar(char *word, int i) {
  int length = strlen(word);
  if (i < length - 1)
    printchar(word, i + 1);
  printf("%c", word[i]);
}


x86 assembly (clang, -O0):
<printchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    116b <printchar+0x3b>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1030 <printchar@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xe86(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1050 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printchar>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
call   1040 <strlen@plt>
add    $0xffffffff,%eax
cmp    %r14d,%eax
jle    1153 <printchar+0x23>
lea    0x1(%r14),%esi
mov    %rbx,%rdi
call   1030 <printchar@plt>
movslq %r14d,%rax
movsbl (%rbx,%rax,1),%esi
lea    0xe9f(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @printchar(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = sub nsw i32 %9, 1
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %16
12: ; preds = %2
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
br label %16
16: ; preds = %12, %2
%17 = load i8*, i8** %3
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %21)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @printchar(i8* %0, i32 %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = add nsw i32 %3, -1
%5 = icmp sgt i32 %4, %1
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = add nsw i32 %1, 1
tail call void @printchar(i8* %0, i32 %7)
br label %8
8: ; preds = %6, %2
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void printXmlTwoDigits(int *data, unsigned int offset, const char *name) {
  if (offset > 0) {
    printf("%*c", offset, ' ');
  }
  printf("<%s>%i</%s>\n", name, *data, name);
}


x86 assembly (clang, -O0):
<printXmlTwoDigits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
jbe    1143 <printXmlTwoDigits+0x33>
mov    -0xc(%rbp),%esi
lea    0xec9(%rip),%rdi
mov    $0x20,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
mov    (%rax),%edx
mov    -0x18(%rbp),%rcx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printXmlTwoDigits>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
test   %esi,%esi
je     1131 <printXmlTwoDigits+0x21>
lea    0xedb(%rip),%rdi
mov    $0x20,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    (%r14),%edx
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
mov    %rbx,%rcx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%*c\00"
@.str.1 = [13 x i8] c"<%s>%i</%s>\0A\00"
define void @printXmlTwoDigits(i32* %0, i32 %1, i8* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = icmp ugt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10, i32 32)
br label %12
12: ; preds = %9, %3
%13 = load i8*, i8** %6
%14 = load i32*, i32** %4
%15 = load i32, i32* %14
%16 = load i8*, i8** %6
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %13, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%*c\00"
@.str.1 = [13 x i8] c"<%s>%i</%s>\0A\00"
define void @printXmlTwoDigits(i32* nocapture %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %7, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1, i32 32)
br label %7
7: ; preds = %5, %3
%8 = load i32, i32* %0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %8, i8* %2)
ret void
}
/* Type definitions */
typedef int uint16_t;
typedef int int32_t;
typedef scalar_t__ int16_t;

/* Variables and functions */
int CHAR_BIT;
int32_t oph_2s16_to_s32(int16_t *_array, unsigned int _index1,
                        unsigned int _index2) {
  return ((int32_t)_array[_index2] << (CHAR_BIT * sizeof(int32_t) / 2)) |
         ((uint16_t)_array[_index1]);
}


x86 assembly (clang, -O0):
<oph_2s16_to_s32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    (%rax,%rcx,8),%rax
mov    0x2ec0(%rip),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
shr    $0x1,%rcx
shl    %cl,%eax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
mov    (%rcx,%rdx,8),%rcx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<oph_2s16_to_s32>:
mov    %edx,%eax
mov    (%rdi,%rax,8),%eax
mov    0x2ed4(%rip),%rcx
mov    (%rcx),%cl
add    %cl,%cl
shl    %cl,%eax
mov    %esi,%ecx
or     (%rdi,%rcx,8),%eax
ret

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define i32 @oph_2s16_to_s32(i64* %0, i32 %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i32
store i64* %0, i64** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i64*, i64** %4
%8 = load i32, i32* %6
%9 = zext i32 %8 to i64
%10 = getelementptr inbounds i64, i64* %7, i64 %9
%11 = load i64, i64* %10
%12 = trunc i64 %11 to i32
%13 = load i32, i32* @CHAR_BIT
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 4
%16 = udiv i64 %15, 2
%17 = trunc i64 %16 to i32
%18 = shl i32 %12, %17
%19 = load i64*, i64** %4
%20 = load i32, i32* %5
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i64, i64* %19, i64 %21
%23 = load i64, i64* %22
%24 = trunc i64 %23 to i32
%25 = or i32 %18, %24
ret i32 %25
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define i32 @oph_2s16_to_s32(i64* nocapture %0, i32 %1, i32 %2) {
%4 = zext i32 %2 to i64
%5 = getelementptr inbounds i64, i64* %0, i64 %4
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
%8 = load i32, i32* @CHAR_BIT
%9 = shl i32 %8, 1
%10 = shl i32 %7, %9
%11 = zext i32 %1 to i64
%12 = getelementptr inbounds i64, i64* %0, i64 %11
%13 = load i64, i64* %12
%14 = trunc i64 %13 to i32
%15 = or i32 %10, %14
ret i32 %15
}
/* Variables and functions */
float produitScalaire(double *, double *, int);
float distanceEuclidienne(double *trainDescriptor, double *valDescriptor) {
  return produitScalaire(trainDescriptor, valDescriptor, 64);
}


x86 assembly (clang, -O0):
<distanceEuclidienne>:
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    $0x40,%edx
call   1030 <produitScalaire@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distanceEuclidienne>:
mov    $0x40,%edx
jmp    1030 <produitScalaire@plt>

LLVM IR (-O0):
define float @distanceEuclidienne(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 float @produitScalaire(double* %5, double* %6, i32 64)
ret float %7
}

LLVM IR (-O2):
define float @distanceEuclidienne(double* %0, double* %1) {
%3 = tail call float @produitScalaire(double* %0, double* %1, i32 64)
ret float %3
}
/* Variables and functions */
int booster_lxstat64(int, char const *, void *);
int __lxstat64(int ver, const char *path, void *buf) {
  return booster_lxstat64(ver, path, buf);
}


x86 assembly (clang, -O0):
<__lxstat64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <booster_lxstat64@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @__lxstat64(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = call i32 @booster_lxstat64(i32 %7, i8* %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @__lxstat64(i32 %0, i8* %1, i8* %2) {
%4 = tail call i32 @booster_lxstat64(i32 %0, i8* %1, i8* %2)
ret i32 %4
}
void gtk_dialog_get_has_separator() {}


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

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

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

LLVM IR (-O2):
define void @gtk_dialog_get_has_separator() {
ret void
}
void f2(void *ass_t, int a, int *b) {
  int tmp = *b;
  *b = a;
  a = tmp;
}


x86 assembly (clang, -O0):
<f2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
mov    %eax,-0xc(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<f2>:
mov    %esi,(%rdx)
ret

LLVM IR (-O0):
define void @f2(i8* %0, i32 %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
store i32 %9, i32* %7
%10 = load i32, i32* %5
%11 = load i32*, i32** %6
store i32 %10, i32* %11
%12 = load i32, i32* %7
store i32 %12, i32* %5
ret void
}

LLVM IR (-O2):
define void @f2(i8* nocapture readnone %0, i32 %1, i32* nocapture writeonly %2) {
store i32 %1, i32* %2
ret void
}
char *lastPathComponent(char *source) {
  char *last = rindex(source, '/');
  if (last && last != '\0') {
    *last++;
    return last;
  } else {
    return source;
  }
}


x86 assembly (clang, -O0):
<lastPathComponent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <rindex@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115d <lastPathComponent+0x4d>
cmpq   $0x0,-0x18(%rbp)
je     115d <lastPathComponent+0x4d>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1165 <lastPathComponent+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lastPathComponent>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <rindex@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @lastPathComponent(i8* %0) {
%2 = tail call i8* @rindex(i8* %0, i32 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ my_putchar(char);
int my_putnchar(char c, int nb) {
  int i;
  i = -1;
  while (++i < nb)
    my_putchar(c);
  return (0);
}


x86 assembly (clang, -O0):
<my_putnchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xffffffff,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    -0x8(%rbp),%eax
jge    1148 <my_putnchar+0x38>
movsbl -0x1(%rbp),%edi
call   1030 <my_putchar@plt>
jmp    1128 <my_putnchar+0x18>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_putnchar>:
push   %rbp
push   %rbx
push   %rax
test   %esi,%esi
jle    112c <my_putnchar+0x1c>
mov    %esi,%ebx
movsbl %dil,%ebp
nopl   (%rax)
mov    %ebp,%edi
call   1030 <my_putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <my_putnchar+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @my_putnchar(i8 signext %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %9
4: ; preds = %2, %4
%5 = phi i32 [ %7, %4 ], [ 0, %2 ]
%6 = tail call i32 @my_putchar(i8 signext %0)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq i32 %7, %1
br i1 %8, label %9, label %4
9: ; preds = %4, %2
ret i32 0
}
void abcde4fghijklmn9opqrstuvwxzy() {}


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

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

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

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