xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
void od_copy_2x2_16_c(unsigned char *_dst, int _dstride,
                      const unsigned char *_src, int _sstride) {
  int y;
  for (y = 0; y < 2; y++) {
    memcpy(_dst, _src, 2 << 1);
    _dst += _dstride;
    _src += _sstride;
  }
}


x86 assembly (clang, -O0):
<od_copy_2x2_16_c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x2,-0x20(%rbp)
jge    1179 <od_copy_2x2_16_c+0x69>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112d <od_copy_2x2_16_c+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<od_copy_2x2_16_c>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%r15
movslq %esi,%rbx
movslq %ecx,%r12
mov    %rdx,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    %r15,%rbx
add    %r14,%r12
mov    %rbx,%rdi
mov    %r12,%rsi
mov    $0x4,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @od_copy_2x2_16_c(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = sext i32 %1 to i64
%6 = sext i32 %3 to i64
%7 = tail call i32 @memcpy(i8* %0, i8* %2, i32 4)
%8 = getelementptr inbounds i8, i8* %0, i64 %5
%9 = getelementptr inbounds i8, i8* %2, i64 %6
%10 = tail call i32 @memcpy(i8* %8, i8* %9, i32 4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ XLaunchXBE(char *);
int fb_hShell(char *program) {
  XLaunchXBE(program);
  return -1;
}


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

x86 assembly (clang, -O2):
<fb_hShell>:
push   %rax
call   1030 <XLaunchXBE@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @fb_hShell(i8* %0) {
%2 = tail call i32 @XLaunchXBE(i8* %0)
ret i32 -1
}
int main(int argc, const char *argv[]) {
#pragma mark 普通类型
#pragma mark 进制转换
#pragma mark int型最大值与最小值
#pragma mark
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
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
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int fread(scalar_t__ *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *);
void read_ID(FILE *infile, uint8_t *buf) {
  if (fread(buf, 1, 4, infile) < 4) {
    printf("file ended unexpectedly\n");
    exit(1);
  }
  buf[4] = 0;
}


x86 assembly (clang, -O0):
<read_ID>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x4,%edx
call   1030 <fread@plt>
cmp    $0x4,%eax
jge    1176 <read_ID+0x46>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,0x20(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_ID>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rcx
mov    %rsi,%rdi
mov    $0x1,%esi
mov    $0x4,%edx
call   1040 <fread@plt>
cmp    $0x3,%eax
jle    1158 <read_ID+0x28>
movq   $0x0,0x20(%rbx)
pop    %rbx
ret
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"file ended unexpectedly\0A\00"
define void @read_ID(i32* %0, i64* %1) {
%3 = alloca i32*
%4 = alloca i64*
store i32* %0, i32** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
%6 = load i32*, i32** %3
%7 = call i32 @fread(i64* %5, i32 1, i32 4, i32* %6)
%8 = icmp slt i32 %7, 4
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %2
%13 = load i64*, i64** %4
%14 = getelementptr inbounds i64, i64* %13, i64 4
store i64 0, i64* %14
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"file ended unexpectedly\00"
define void @read_ID(i32* nocapture %0, i64* nocapture %1) {
%3 = tail call i32 @fread(i64* %1, i32 1, i32 4, i32* %0)
%4 = icmp slt i32 %3, 4
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i64, i64* %1, i64 4
store i64 0, i64* %9
ret void
}
/* Variables and functions */
bool isInteger(float val) {
  int truncated = (int)val;
  return (val == truncated);
}


x86 assembly (clang, -O0):
<isInteger>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
cvttss2si -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
ucomiss %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isInteger>:
cvttps2dq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
cmpeqss %xmm0,%xmm1
movd   %xmm1,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isInteger(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fptosi float %4 to i32
store i32 %5, i32* %3
%6 = load float, float* %2
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to float
%9 = fcmp oeq float %6, %8
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @isInteger(float %0) {
%2 = fptosi float %0 to i32
%3 = sitofp i32 %2 to float
%4 = fcmp oeq float %3, %0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(int *, int *, int);
void copy9(int *x, int *y) { memcpy(x, y, 9); }


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

x86 assembly (clang, -O2):
<copy9>:
mov    $0x9,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @copy9(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 = call i32 @memcpy(i32* %5, i32* %6, i32 9)
ret void
}

LLVM IR (-O2):
define void @copy9(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %0, i32* %1, i32 9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int rand();
unsigned char make_session(void) {
  puts("called make_session");
  return (unsigned char)(rand() % 0xff);
}


x86 assembly (clang, -O0):
<make_session>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1040 <rand@plt>
mov    $0xff,%ecx
cltd
idiv   %ecx
mov    %dl,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_session>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff80808081,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
shr    $0x7,%eax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"called make_session\00"
define zeroext i8 @make_session() {
%1 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 255
%4 = trunc i32 %3 to i8
ret i8 %4
}

LLVM IR (-O2):
@.str = [20 x i8] c"called make_session\00"
define zeroext i8 @make_session() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, 255
%4 = trunc i32 %3 to i8
ret i8 %4
}
/* Variables and functions */
int /*<<< orphan*/ dorename(char *, char *);
int /*<<< orphan*/ errx(int, char *);
int main(int argc, char *argv[]) {
  if (argc != 3) {
    errx(1, "Usage: mv oldfile newfile");
  }
  dorename(argv[1], argv[2]);
  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)
cmpl   $0x3,-0x8(%rbp)
je     1151 <main+0x31>
mov    $0x1,%edi
lea    0xeb4(%rip),%rsi
call   1030 <errx@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1040 <dorename@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x3,%edi
je     113a <main+0x1a>
lea    0xed0(%rip),%rsi
mov    $0x1,%edi
call   1030 <errx@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
call   1040 <dorename@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Usage: mv oldfile newfile\00"
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* %4
%7 = icmp ne i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @errx(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @dorename(i8* %13, i8* %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Usage: mv oldfile newfile\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @errx(i32 1, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @dorename(i8* %8, i8* %10)
ret i32 0
}
int par_vol_knb_cap(struct xhda_codec *codec, struct xhda_node *node,
                    unsigned int cmd) {
  return 0;
}


x86 assembly (clang, -O0):
<par_vol_knb_cap>:
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):
<par_vol_knb_cap>:
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.xhda_codec = type opaque
%struct.xhda_node = type opaque
define i32 @par_vol_knb_cap(%struct.xhda_codec* %0, %struct.xhda_node* %1, i32 %2) {
%4 = alloca %struct.xhda_codec*
%5 = alloca %struct.xhda_node*
%6 = alloca i32
store %struct.xhda_codec* %0, %struct.xhda_codec** %4
store %struct.xhda_node* %1, %struct.xhda_node** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.xhda_codec = type opaque
%struct.xhda_node = type opaque
define i32 @par_vol_knb_cap(%struct.xhda_codec* nocapture readnone %0, %struct.xhda_node* nocapture readnone %1, i32 %2) {
ret i32 0
}
void av_packet_free_side_data() {}


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

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

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

LLVM IR (-O2):
define void @av_packet_free_side_data() {
ret void
}
void real_bswap4(unsigned char *b) {
  unsigned char byte;
  byte = b[0];
  b[0] = b[3];
  b[3] = byte;
  byte = b[1];
  b[1] = b[2];
  b[2] = byte;
}


x86 assembly (clang, -O0):
<real_bswap4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%al
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<real_bswap4>:
mov    (%rdi),%al
mov    0x3(%rdi),%cl
mov    %cl,(%rdi)
mov    %al,0x3(%rdi)
rolw   $0x8,0x1(%rdi)
ret

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

LLVM IR (-O2):
define void @real_bswap4(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = getelementptr inbounds i8, i8* %0, i64 3
%4 = load i8, i8* %3
store i8 %4, i8* %0
store i8 %2, i8* %3
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = load i8, i8* %7
store i8 %8, i8* %5
store i8 %6, i8* %7
ret void
}
int test_endianness_vol() {
  union doubleword {
    volatile double d;
    volatile long u[2];
  } dw;
  dw.d = 10;
  return dw.u[0] != 0 ? 1 : 0;
}


x86 assembly (clang, -O0):
<test_endianness_vol>:
push   %rbp
mov    %rsp,%rbp
movsd  0xef4(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_endianness_vol>:
movabs $0x4024000000000000,%rax
mov    %rax,-0x8(%rsp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rsp)
setne  %al
ret

LLVM IR (-O0):
%union.doubleword = type { [2 x i64] }
define i32 @test_endianness_vol() {
%1 = alloca %union.doubleword
%2 = bitcast %union.doubleword* %1 to double*
store volatile double 1.000000e+01, double* %2
%3 = bitcast %union.doubleword* %1 to [2 x i64]*
%4 = getelementptr inbounds [2 x i64], [2 x i64]* %3, i64 0, i64 0
%5 = load volatile i64, i64* %4
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 1, i32 0
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_endianness_vol() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store volatile i64 4621819117588971520, i64* %1
%3 = load volatile i64, i64* %1
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int htoi(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main(int argc, char *argv[]) {
  char *s = "0xDEADBEEF";
  int nb;
  if (argc > 1)
    s = argv[1];
  nb = htoi(s);
  printf("%s -> %u\n", s, nb);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1157 <main+0x37>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <htoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
lea    0xe9a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jl     112c <main+0xc>
mov    0x8(%rsi),%rbx
jmp    1133 <main+0x13>
lea    0xecd(%rip),%rbx
mov    %rbx,%rdi
call   1040 <htoi@plt>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"0xDEADBEEF\00"
@.str.1 = [10 x i8] c"%s -> %u\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
br label %7
7: ; preds = %4, %2
%8 = phi i8* [ %6, %4 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), %2 ]
%9 = tail call i32 @htoi(i8* %8)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 %9)
ret i32 0
}
void gtk_icon_source_set_size_wildcarded() {}


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

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

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

LLVM IR (-O2):
define void @gtk_icon_source_set_size_wildcarded() {
ret void
}
__attribute__((patchable_function_entry(2, 0))) void f20() {}


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

x86 assembly (clang, -O2):
<f20>:
xchg   %ax,%ax
ret

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

LLVM IR (-O2):
define void @f20() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _sleep(unsigned long);
void sleep(unsigned long t_) { _sleep(t_); }


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

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

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

LLVM IR (-O2):
define void @sleep(i64 %0) {
%2 = tail call i32 @_sleep(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lib_free(char *);
char *util_concat(char *, char const *, int /*<<< orphan*/ *);
void util_addline(char **list, const char *line) {
  char *tmp;
  tmp = util_concat(*list, line, NULL);
  lib_free(*list);
  *list = tmp;
}


x86 assembly (clang, -O0):
<util_addline>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <util_concat@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <lib_free@plt>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_addline>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
xor    %edx,%edx
call   1040 <util_concat@plt>
mov    %rax,%r14
mov    (%rbx),%rdi
call   1030 <lib_free@plt>
mov    %r14,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @util_addline(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
%5 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = call i8* @util_concat(i8* %7, i8* %8, i32* null)
store i8* %9, i8** %5
%10 = load i8**, i8*** %3
%11 = load i8*, i8** %10
%12 = call i32 @lib_free(i8* %11)
%13 = load i8*, i8** %5
%14 = load i8**, i8*** %3
store i8* %13, i8** %14
ret void
}

LLVM IR (-O2):
define void @util_addline(i8** nocapture %0, i8* %1) {
%3 = load i8*, i8** %0
%4 = tail call i8* @util_concat(i8* %3, i8* %1, i32* null)
%5 = load i8*, i8** %0
%6 = tail call i32 @lib_free(i8* %5)
store i8* %4, i8** %0
ret void
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ rev(int);
int main() {
  int ls = __VERIFIER_nondet_int();
  if (ls >= 0) {
    rev(ls);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     114b <main+0x2b>
mov    -0x8(%rbp),%edi
call   1030 <rev@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_int@plt>
test   %eax,%eax
js     1133 <main+0x13>
mov    %eax,%edi
call   1030 <rev@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_int()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = call i32 @rev(i32 %7)
br label %9
9: ; preds = %6, %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = icmp sgt i32 %1, -1
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @rev(i32 %1)
br label %5
5: ; preds = %3, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
void usage(const char *progname) {
  fprintf(stderr,
          "\nUsage: %s [options] <payload>\n"
          "Options:\n"
          "  -4            only IPv4\n"
          "  -6            only IPv6\n"
          "  -c <clock>    monotonic (default) or tai\n"
          "  -D <addr>     destination IP address (server)\n"
          "  -S <addr>     source IP address (client)\n"
          "  -r            run rx mode\n"
          "  -t <nsec>     start time (UTC nanoseconds)\n"
          "  -m <mark>     socket mark\n"
          "\n",
          progname);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [329 x i8] c"\0AUsage: %s [options] <payload>\0AOptions:\0A -4 only IPv4\0A -6 only IPv6\0A -c <clock> monotonic (default) or tai\0A -D <addr> destination IP address (server)\0A -S <addr> source IP address (client)\0A -r run rx mode\0A -t <nsec> start time (UTC nanoseconds)\0A -m <mark> socket mark\0A\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([329 x i8], [329 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [329 x i8] c"\0AUsage: %s [options] <payload>\0AOptions:\0A -4 only IPv4\0A -6 only IPv6\0A -c <clock> monotonic (default) or tai\0A -D <addr> destination IP address (server)\0A -S <addr> source IP address (client)\0A -r run rx mode\0A -t <nsec> start time (UTC nanoseconds)\0A -m <mark> socket mark\0A\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([329 x i8], [329 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ inet_addr(char const *);
unsigned long ntohl(int /*<<< orphan*/);
int /*<<< orphan*/ *strchr(char const *, char);
unsigned long strtol(char const *, int /*<<< orphan*/ *, int /*<<< orphan*/);
unsigned long parseIpAddress(const char *value) {
  if (strchr(value, '.') == NULL)
    return (strtol(value, NULL, 0));
  return (ntohl(inet_addr(value)));
}


x86 assembly (clang, -O0):
<parseIpAddress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strchr@plt>
cmp    $0x0,%rax
jne    117c <parseIpAddress+0x3c>
mov    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1050 <strtol@plt>
mov    %rax,-0x8(%rbp)
jmp    1190 <parseIpAddress+0x50>
mov    -0x10(%rbp),%rdi
call   1040 <inet_addr@plt>
mov    %eax,%edi
call   1060 <ntohl@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseIpAddress>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2e,%esi
call   1030 <strchr@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     1163 <parseIpAddress+0x23>
call   1040 <inet_addr@plt>
mov    %eax,%edi
pop    %rbx
jmp    1060 <ntohl@plt>
xor    %esi,%esi
xor    %edx,%edx
pop    %rbx
jmp    1050 <strtol@plt>

LLVM IR (-O0):
define i64 @parseIpAddress(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32* @strchr(i8* %4, i8 signext 46)
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i8*, i8** %3
%9 = call i64 @strtol(i8* %8, i32* null, i32 0)
store i64 %9, i64* %2
br label %14
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @inet_addr(i8* %11)
%13 = call i64 @ntohl(i32 %12)
store i64 %13, i64* %2
br label %14
14: ; preds = %10, %7
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @parseIpAddress(i8* %0) {
%2 = tail call i32* @strchr(i8* %0, i8 signext 46)
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 0)
br label %9
6: ; preds = %1
%7 = tail call i32 @inet_addr(i8* %0)
%8 = tail call i64 @ntohl(i32 %7)
br label %9
9: ; preds = %6, %4
%10 = phi i64 [ %5, %4 ], [ %8, %6 ]
ret i64 %10
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ tcgetattr(int /*<<< orphan*/, struct termios *);
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios *);
void tty_mode(int how) {
  static struct termios old_mode;
  if (how == 0)
    tcgetattr(0, &old_mode);
  else
    tcsetattr(0, TCSANOW, &old_mode);
}


x86 assembly (clang, -O0):
<tty_mode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1148 <tty_mode+0x28>
xor    %edi,%edi
lea    0x2ef6(%rip),%rsi
call   1030 <tcgetattr@plt>
jmp    115f <tty_mode+0x3f>
mov    0x2e99(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    0x2eda(%rip),%rdx
call   1040 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tty_mode>:
test   %edi,%edi
je     113b <tty_mode+0x1b>
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
lea    0x2f00(%rip),%rdx
xor    %edi,%edi
jmp    1040 <tcsetattr@plt>
lea    0x2ef2(%rip),%rsi
xor    %edi,%edi
jmp    1030 <tcgetattr@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@tty_mode.old_mode = internal global %struct.termios zeroinitializer
@TCSANOW = global i32 0
define void @tty_mode(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @tcgetattr(i32 0, %struct.termios* @tty_mode.old_mode)
br label %10
7: ; preds = %1
%8 = load i32, i32* @TCSANOW
%9 = call i32 @tcsetattr(i32 0, i32 %8, %struct.termios* @tty_mode.old_mode)
br label %10
10: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@tty_mode.old_mode = internal global %struct.termios zeroinitializer
@TCSANOW = global i32 0
define void @tty_mode(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @tcgetattr(i32 0, %struct.termios* @tty_mode.old_mode)
br label %8
5: ; preds = %1
%6 = load i32, i32* @TCSANOW
%7 = tail call i32 @tcsetattr(i32 0, i32 %6, %struct.termios* @tty_mode.old_mode)
br label %8
8: ; preds = %5, %3
ret void
}
void swap(int *a, int h, int j) {
  int temp;
  temp = *(a + h);
  *(a + h) = *(a + j);
  *(a + j) = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int test_imm_85int16_reg(short val) {
  return ((val) & (-0x85 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_85int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0xffffff7b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_85int16_reg>:
test   $0xff7b,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_85int16_reg(i16 signext %0) {
%2 = and i16 %0, -133
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int main(void) {
  int a = -1;
  int b = 0x7fffffff;
  int c = 2;
  int t = 1 - ((a - b) / c);
  if (t != (1 - (-1 - 0x7fffffff) / 2))
    __builtin_abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
movl   $0x7fffffff,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x40000001,-0x14(%rbp)
je     115c <main+0x4c>
call   1030 <abort@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
store i32 2147483647, i32* %3
store i32 2, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = load i32, i32* %4
%10 = sdiv i32 %8, %9
%11 = sub nsw i32 1, %10
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = icmp ne i32 %12, 1073741825
br i1 %13, label %14, label %15
14: ; preds = %0
unreachable
15: ; preds = %0
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ AddCommandToQueue(char *, int);
int /*<<< orphan*/ SendFileCleanup();
void SendFileFinish() {
  AddCommandToQueue("END", 2);
  SendFileCleanup();
}


x86 assembly (clang, -O0):
<SendFileFinish>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
mov    $0x2,%esi
call   1030 <AddCommandToQueue@plt>
mov    $0x0,%al
call   1040 <SendFileCleanup@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<SendFileFinish>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x2,%esi
call   1030 <AddCommandToQueue@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <SendFileCleanup@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"END\00"
define void @SendFileFinish() {
%1 = call i32 @AddCommandToQueue(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = call i32 (...) @SendFileCleanup()
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"END\00"
define void @SendFileFinish() {
%1 = tail call i32 @AddCommandToQueue(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 2)
%2 = tail call i32 (...) @SendFileCleanup()
ret void
}
/* Variables and functions */
float pow(float, float);
float potencia(float base, float expo) {
  float num;
  num = pow(base, expo);
  return num;
}


x86 assembly (clang, -O0):
<potencia>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <pow@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @potencia(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %3
store float %1, float* %4
%6 = load float, float* %3
%7 = load float, float* %4
%8 = call float @pow(float %6, float %7)
store float %8, float* %5
%9 = load float, float* %5
ret float %9
}

LLVM IR (-O2):
define float @potencia(float %0, float %1) {
%3 = tail call float @pow(float %0, float %1)
ret float %3
}
int myfunction(int arg) {
  int i, j, r;
  j = 0;
  r = arg;
top:
  ++j;
  if (j == 10)
    goto done;
  for (i = 0; i < 10; ++i) {
    r += i;
    if (j % 2)
      goto top;
  }
done:
  return r;
}


x86 assembly (clang, -O0):
<myfunction>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jne    112c <myfunction+0x2c>
jmp    1177 <myfunction+0x77>
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1172 <myfunction+0x72>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     115f <myfunction+0x5f>
jmp    1114 <myfunction+0x14>
jmp    1164 <myfunction+0x64>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1133 <myfunction+0x33>
jmp    1177 <myfunction+0x77>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<myfunction>:
lea    0x2d(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @myfunction(i32 %0) {
%2 = add i32 %0, 45
ret i32 %2
}
void wx11fr(type) int *type;
{ wx1102(type); }


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

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

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

LLVM IR (-O2):
define void @wx11fr(i32* %0) {
%2 = tail call i32 (i32*, ...) bitcast (i32 (...)* @wx1102 to i32 (i32*, ...)*)(i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int x;
  printf("Digite um numero!");
  scanf("%d", &x);
  printf("O numero informado foi %d", x);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [18 x i8] c"Digite um numero!\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"O numero informado foi %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Digite um numero!\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [26 x i8] c"O numero informado foi %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_version() {
  printf("Sink v1.0\n"
         "Copyright (c) 2016-2018 Sean Connelly (@voidqk), MIT License\n"
         "https://github.com/voidqk/sink  http://sean.cm\n");
}


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

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

LLVM IR (-O0):
@.str = [119 x i8] c"Sink v1.0\0ACopyright (c) 2016-2018 Sean Connelly (@voidqk), MIT License\0Ahttps://github.com/voidqk/sink http://sean.cm\0A\00"
define void @print_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([119 x i8], [119 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [118 x i8] c"Sink v1.0\0ACopyright (c) 2016-2018 Sean Connelly (@voidqk), MIT License\0Ahttps://github.com/voidqk/sink http://sean.cm\00"
define void @print_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([118 x i8], [118 x i8]* @str, i64 0, i64 0))
ret void
}
int equal_keys(const void *keyA, int hashA, const void *keyB, int hashB,
               int (*equals)(const void *, const void *)) {
  if (keyA == keyB) {
    return 1;
  }
  if (hashA != hashB) {
    return 0;
  }
  return equals(keyA, keyB);
}


x86 assembly (clang, -O0):
<equal_keys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1134 <equal_keys+0x34>
movl   $0x1,-0x4(%rbp)
jmp    115d <equal_keys+0x5d>
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     114c <equal_keys+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    115d <equal_keys+0x5d>
mov    -0x30(%rbp),%rax
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   *%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_keys>:
cmp    %rdx,%rdi
je     1111 <equal_keys+0x11>
xor    %eax,%eax
cmp    %ecx,%esi
jne    1116 <equal_keys+0x16>
mov    %rdx,%rsi
jmp    *%r8
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @equal_keys(i8* %0, i32 %1, i8* %2, i32 %3, i32 (i8*, i8*)* nocapture %4) {
%6 = icmp eq i8* %0, %2
br i1 %6, label %11, label %7
7: ; preds = %5
%8 = icmp eq i32 %1, %3
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = tail call i32 %4(i8* %0, i8* %2)
br label %11
11: ; preds = %7, %5, %9
%12 = phi i32 [ %10, %9 ], [ 1, %5 ], [ 0, %7 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage: expand [-t tablist] [file ...]\n");
  exit(1);
}


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    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [39 x i8] c"usage: expand [-t tablist] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [39 x i8] c"usage: expand [-t tablist] [file ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
int Abs(unsigned char a) {
  if (a & 128)
    return 256 - a;
  else
    return a;
}


x86 assembly (clang, -O0):
<Abs>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     112f <Abs+0x2f>
movzbl -0x5(%rbp),%ecx
mov    $0x100,%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    1136 <Abs+0x36>
movzbl -0x5(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Abs>:
mov    $0x100,%eax
sub    %edi,%eax
test   $0x80,%dil
cmove  %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @Abs(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = and i32 %2, 128
%4 = icmp eq i32 %3, 0
%5 = sub nuw nsw i32 256, %2
%6 = select i1 %4, i32 %2, i32 %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint32_t;

/* Variables and functions */
uint32_t SysExcIntStatus(bool bMasked) {
  if (bMasked) {
    return ((*((volatile uint32_t *)(0x400F9008))));
  } else {
    return ((*((volatile uint32_t *)(0x400F9000))));
  }
}


x86 assembly (clang, -O0):
<SysExcIntStatus>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1120 <SysExcIntStatus+0x20>
mov    $0x400f9008,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    112a <SysExcIntStatus+0x2a>
mov    $0x400f9000,%eax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<SysExcIntStatus>:
xor    %eax,%eax
test   %edi,%edi
setne  %al
mov    0x400f9000(,%rax,8),%eax
ret

LLVM IR (-O0):
define i32 @SysExcIntStatus(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load volatile i32, i32* inttoptr (i64 1074761736 to i32*)
store i32 %7, i32* %2
br label %10
8: ; preds = %1
%9 = load volatile i32, i32* inttoptr (i64 1074761728 to i32*)
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @SysExcIntStatus(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32* inttoptr (i64 1074761728 to i32*), i32* inttoptr (i64 1074761736 to i32*)
%4 = load volatile i32, i32* %3
ret i32 %4
}