xunge/DecIR huggingface dataset:
void swap(int *num1, int *num2) {
  int num2Value = *num2;
  *num2 = *num1;
  *num1 = num2Value;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rsi),%eax
mov    (%rdi),%ecx
mov    %ecx,(%rsi)
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = load i32, i32* %0
store i32 %4, i32* %1
store i32 %3, i32* %0
ret void
}
void init_twait() {}


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

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

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

LLVM IR (-O2):
define void @init_twait() {
ret void
}
void pcp_print_pwr_temp_stats(struct activity *a, int curr) {}


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

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

LLVM IR (-O0):
%struct.activity = type opaque
define void @pcp_print_pwr_temp_stats(%struct.activity* %0, i32 %1) {
%3 = alloca %struct.activity*
%4 = alloca i32
store %struct.activity* %0, %struct.activity** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.activity = type opaque
define void @pcp_print_pwr_temp_stats(%struct.activity* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SerialWriteString(char *);
void iRobot_PlaySong(unsigned short song_number) {
  char data[] = {141, song_number};
  SerialWriteString(data);
}


x86 assembly (clang, -O0):
<iRobot_PlaySong>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movb   $0x8d,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    %al,-0x3(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <SerialWriteString@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iRobot_PlaySong>:
push   %rax
movb   $0x8d,0x6(%rsp)
mov    %dil,0x7(%rsp)
lea    0x6(%rsp),%rdi
call   1030 <SerialWriteString@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @iRobot_PlaySong(i16 zeroext %0) {
%2 = alloca i16
%3 = alloca [2 x i8]
store i16 %0, i16* %2
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
store i8 -115, i8* %4
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = load i16, i16* %2
%7 = trunc i16 %6 to i8
store i8 %7, i8* %5
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %3, i64 0, i64 0
%9 = call i32 @SerialWriteString(i8* %8)
ret void
}

LLVM IR (-O2):
define void @iRobot_PlaySong(i16 zeroext %0) {
%2 = alloca [2 x i8]
%3 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 0
store i8 -115, i8* %3
%4 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%5 = trunc i16 %0 to i8
store i8 %5, i8* %4
%6 = call i32 @SerialWriteString(i8* %3)
ret void
}
/* Variables and functions */
unsigned int __sw_hweight16(unsigned int);
unsigned int __arch_hweight16(unsigned int w) { return __sw_hweight16(w); }


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

x86 assembly (clang, -O2):
<__arch_hweight16>:
jmp    1030 <__sw_hweight16@plt>

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

LLVM IR (-O2):
define i32 @__arch_hweight16(i32 %0) {
%2 = tail call i32 @__sw_hweight16(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
extern void svg_srand(void) { srand(time(NULL)); }


x86 assembly (clang, -O0):
<svg_srand>:
push   %rbp
mov    %rsp,%rbp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @svg_srand() {
%1 = call i32 @time(i32* null)
%2 = call i32 @srand(i32 %1)
ret void
}

LLVM IR (-O2):
define void @svg_srand() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
ret void
}
/* Type definitions */
struct user_regs_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ exec_by_all_variants(int, int *);
void sys_brk(int variant_count, int *child, struct user_regs_struct *regs) {
  exec_by_all_variants(variant_count, child);
}


x86 assembly (clang, -O0):
<sys_brk>:
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
call   1030 <exec_by_all_variants@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_brk>:
jmp    1030 <exec_by_all_variants@plt>

LLVM IR (-O0):
%struct.user_regs_struct = type { i32 }
define void @sys_brk(i32 %0, i32* %1, %struct.user_regs_struct* %2) {
%4 = alloca i32
%5 = alloca i32*
%6 = alloca %struct.user_regs_struct*
store i32 %0, i32* %4
store i32* %1, i32** %5
store %struct.user_regs_struct* %2, %struct.user_regs_struct** %6
%7 = load i32, i32* %4
%8 = load i32*, i32** %5
%9 = call i32 @exec_by_all_variants(i32 %7, i32* %8)
ret void
}

LLVM IR (-O2):
%struct.user_regs_struct = type { i32 }
define void @sys_brk(i32 %0, i32* %1, %struct.user_regs_struct* nocapture readnone %2) {
%4 = tail call i32 @exec_by_all_variants(i32 %0, i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalpha(int);
void t_isalpha_0xcf() {
  Assert_real((isalpha(207) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isalpha.c",
              1040, ("isalpha should be 0 for 0xcf"));
}


x86 assembly (clang, -O0):
<t_isalpha_0xcf>:
push   %rbp
mov    %rsp,%rbp
mov    $0xcf,%edi
call   1030 <isalpha@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x410,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isalpha_0xcf>:
push   %rax
mov    $0xcf,%edi
call   1030 <isalpha@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x410,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xcf\00"
define void @t_isalpha_0xcf() {
%1 = call i64 @isalpha(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalpha.c\00"
@.str.1 = [29 x i8] c"isalpha should be 0 for 0xcf\00"
define void @t_isalpha_0xcf() {
%1 = tail call i64 @isalpha(i32 207)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 1040, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void write_pixel(int x, int y, short colour) {
  volatile short *vga_addr =
      (volatile short *)(0x08000000 + (y << 10) + (x << 1));
  *vga_addr = colour;
}


x86 assembly (clang, -O0):
<write_pixel>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%eax
shl    $0xa,%eax
add    $0x8000000,%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
add    %ecx,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0xa(%rbp),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_pixel>:
shl    $0xa,%esi
lea    (%rsi,%rdi,2),%eax
add    $0x8000000,%eax
cltq
mov    %dx,(%rax)
ret

LLVM IR (-O0):
define void @write_pixel(i32 %0, i32 %1, i16 signext %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i16
%7 = alloca i16*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i16 %2, i16* %6
%8 = load i32, i32* %5
%9 = shl i32 %8, 10
%10 = add nsw i32 134217728, %9
%11 = load i32, i32* %4
%12 = shl i32 %11, 1
%13 = add nsw i32 %10, %12
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i16*
store i16* %15, i16** %7
%16 = load i16, i16* %6
%17 = load i16*, i16** %7
store volatile i16 %16, i16* %17
ret void
}

LLVM IR (-O2):
define void @write_pixel(i32 %0, i32 %1, i16 signext %2) {
%4 = shl i32 %1, 10
%5 = shl i32 %0, 1
%6 = add i32 %5, 134217728
%7 = add i32 %6, %4
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i16*
store volatile i16 %2, i16* %9
ret void
}
/* Variables and functions */
unsigned char gf16_mul_8(unsigned char);
unsigned char gf16_squ(unsigned char);
unsigned char gf256_squ(unsigned char a) {
  unsigned char a0 = a & 15;
  unsigned char a1 = (a >> 4);
  a1 = gf16_squ(a1);
  unsigned char a1squ_x8 = gf16_mul_8(a1);
  return (a1 << 4) ^ a1squ_x8 ^ gf16_squ(a0);
}


x86 assembly (clang, -O0):
<gf256_squ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%edi
call   1030 <gf16_squ@plt>
mov    %al,-0x3(%rbp)
movzbl -0x3(%rbp),%edi
call   1040 <gf16_mul_8@plt>
mov    %al,-0x4(%rbp)
movzbl -0x3(%rbp),%eax
shl    $0x4,%eax
movzbl -0x4(%rbp),%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
movzbl -0x2(%rbp),%edi
call   1030 <gf16_squ@plt>
mov    %al,%cl
mov    -0x8(%rbp),%eax
movzbl %cl,%ecx
xor    %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf256_squ>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    %ebx,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <gf16_squ@plt>
movzbl %al,%ebp
mov    %ebp,%edi
call   1040 <gf16_mul_8@plt>
mov    %eax,%r14d
shl    $0x4,%bpl
and    $0xf,%ebx
mov    %ebx,%edi
call   1030 <gf16_squ@plt>
xor    %bpl,%al
xor    %r14b,%al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @gf256_squ(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %2
%6 = load i8, i8* %2
%7 = zext i8 %6 to i32
%8 = and i32 %7, 15
%9 = trunc i32 %8 to i8
store i8 %9, i8* %3
%10 = load i8, i8* %2
%11 = zext i8 %10 to i32
%12 = ashr i32 %11, 4
%13 = trunc i32 %12 to i8
store i8 %13, i8* %4
%14 = load i8, i8* %4
%15 = call zeroext i8 @gf16_squ(i8 zeroext %14)
store i8 %15, i8* %4
%16 = load i8, i8* %4
%17 = call zeroext i8 @gf16_mul_8(i8 zeroext %16)
store i8 %17, i8* %5
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = shl i32 %19, 4
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = xor i32 %20, %22
%24 = load i8, i8* %3
%25 = call zeroext i8 @gf16_squ(i8 zeroext %24)
%26 = zext i8 %25 to i32
%27 = xor i32 %23, %26
%28 = trunc i32 %27 to i8
ret i8 %28
}

LLVM IR (-O2):
define zeroext i8 @gf256_squ(i8 zeroext %0) {
%2 = and i8 %0, 15
%3 = lshr i8 %0, 4
%4 = tail call zeroext i8 @gf16_squ(i8 zeroext %3)
%5 = tail call zeroext i8 @gf16_mul_8(i8 zeroext %4)
%6 = shl i8 %4, 4
%7 = xor i8 %6, %5
%8 = tail call zeroext i8 @gf16_squ(i8 zeroext %2)
%9 = xor i8 %7, %8
ret i8 %9
}
int __attribute__((weak)) testWeak1() { return 1; }


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

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

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

LLVM IR (-O2):
define weak i32 @testWeak1() {
ret i32 1
}
void dnlc_reduce_cache(void *reduce_percent) {}


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

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

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

LLVM IR (-O2):
define void @dnlc_reduce_cache(i8* nocapture %0) {
ret void
}
int fun124() { return 124; }


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

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

LLVM IR (-O0):
define i32 @fun124() {
ret i32 124
}

LLVM IR (-O2):
define i32 @fun124() {
ret i32 124
}
void ff_hevc_put_hevc_pel_pixels4_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_pel_pixels4_10_sse4() {
ret void
}
int *foo(int *x) { return x; }


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

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i32* @foo(i32* readnone returned %0) {
ret i32* %0
}
char *strchr(s, c)
register char *s, c;
{
  do {
    if (*s == c)
      return (s);
  } while (*s++ != 0);
  return (0);
}


x86 assembly (clang, -O0):
<strchr>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
movsbl -0x11(%rbp),%ecx
cmp    %ecx,%eax
jne    112e <strchr+0x2e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1156 <strchr+0x56>
jmp    1133 <strchr+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    110e <strchr+0xe>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strchr>:
mov    %rdi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%rax),%ecx
cmp    %sil,%cl
je     1122 <strchr+0x22>
add    $0x1,%rax
test   %cl,%cl
jne    1110 <strchr+0x10>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strchr(i8* %0, i8 signext %1) {
br label %3
3: ; preds = %7, %2
%4 = phi i8* [ %0, %2 ], [ %8, %7 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, %1
br i1 %6, label %10, label %7
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
%9 = icmp eq i8 %5, 0
br i1 %9, label %10, label %3
10: ; preds = %7, %3
%11 = phi i8* [ %4, %3 ], [ null, %7 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ runhttpd(int, char *);
int main() {
  runhttpd(8100, ".");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x1fa4,%edi
call   1030 <runhttpd@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
define i32 @main() {
%1 = tail call i32 @runhttpd(i32 8100, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int is_overassigned(int *K, int **network_utilization, int individual,
                    int link) {
  if (network_utilization[individual][link] > K[link]) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_overassigned>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
movslq -0x20(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jle    1142 <is_overassigned+0x42>
movl   $0x1,-0x4(%rbp)
jmp    1149 <is_overassigned+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_overassigned>:
movslq %edx,%rax
mov    (%rsi,%rax,8),%rax
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
xor    %eax,%eax
cmp    (%rdi,%rcx,4),%edx
setg   %al
ret

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

LLVM IR (-O2):
define i32 @is_overassigned(i32* nocapture %0, i32** nocapture %1, i32 %2, i32 %3) {
%5 = sext i32 %2 to i64
%6 = getelementptr inbounds i32*, i32** %1, i64 %5
%7 = load i32*, i32** %6
%8 = sext i32 %3 to i64
%9 = getelementptr inbounds i32, i32* %7, i64 %8
%10 = load i32, i32* %9
%11 = getelementptr inbounds i32, i32* %0, i64 %8
%12 = load i32, i32* %11
%13 = icmp sgt i32 %10, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int exfunc(int);
int hfunc1() { return exfunc(1); }


x86 assembly (clang, -O0):
<hfunc1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exfunc@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @hfunc1() {
%1 = call i32 @exfunc(i32 1)
ret i32 %1
}

LLVM IR (-O2):
define i32 @hfunc1() {
%1 = tail call i32 @exfunc(i32 1)
ret i32 %1
}
void debugpins_task_clr() {}


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

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

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

LLVM IR (-O2):
define void @debugpins_task_clr() {
ret void
}
/* Variables and functions */
char getchar();
int /*<<< orphan*/ isalnum(char);
int /*<<< orphan*/ printf(char *);
char tolower(char);
int playagain(void) {
  char input;
  printf("\nDo you wish to continue? (y\\n) ");
  while (!isalnum(input = getchar()))
    ;
  if (tolower(input) != 'n')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<playagain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%edi
call   1040 <isalnum@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    117b <playagain+0x3b>
jmp    1180 <playagain+0x40>
jmp    1154 <playagain+0x14>
movsbl -0x5(%rbp),%edi
call   1060 <tolower@plt>
movsbl %al,%eax
cmp    $0x6e,%eax
je     11a1 <playagain+0x61>
movl   $0x1,-0x4(%rbp)
jmp    11a8 <playagain+0x68>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<playagain>:
push   %rbx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
nopl   (%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
movsbl %al,%ebx
mov    %ebx,%edi
call   1040 <isalnum@plt>
test   %eax,%eax
je     1150 <playagain+0x10>
mov    %ebx,%edi
call   1060 <tolower@plt>
xor    %ecx,%ecx
cmp    $0x6e,%al
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0ADo you wish to continue? (y\\n) \00"
define i32 @playagain() {
%1 = alloca i32
%2 = alloca i8
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %9, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %2
%6 = call i32 @isalnum(i8 signext %5)
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %10
9: ; preds = %4
br label %4
10: ; preds = %4
%11 = load i8, i8* %2
%12 = call signext i8 @tolower(i8 signext %11)
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 110
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 1, i32* %1
br label %17
16: ; preds = %10
store i32 0, i32* %1
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0ADo you wish to continue? (y\\n) \00"
define i32 @playagain() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %2, %0
%3 = tail call signext i8 (...) @getchar()
%4 = tail call i32 @isalnum(i8 signext %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %2, label %6
6: ; preds = %2
%7 = tail call signext i8 @tolower(i8 signext %3)
%8 = icmp ne i8 %7, 110
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ die(char *, char const *);
void usage(const char *argv0) {
  die("Usage: %s [-n] [-l] [-v] [-p <line prefix>] [-s seed] [<test>...]\n "
      "-n\tNo fork; run all tests in the same process (simpler for "
      "debugging)\n -l\tList tests, but do not run them\n -v\tInvert "
      "selection, only run or list tests not specified in the "
      "command\n\tline.\n -p\tUse the specified prefix instead of a tab on "
      "each line\n -s\tRandom seed used to seed srand() before each test "
      "(default 1)\n -i\tInteractive mode: allow tests to ask for user input\n",
      argv0);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <die@plt>

LLVM IR (-O0):
@.str = [436 x i8] c"Usage: %s [-n] [-l] [-v] [-p <line prefix>] [-s seed] [<test>...]\0A -n\09No fork; run all tests in the same process (simpler for debugging)\0A -l\09List tests, but do not run them\0A -v\09Invert selection, only run or list tests not specified in the command\0A\09line.\0A -p\09Use the specified prefix instead of a tab on each line\0A -s\09Random seed used to seed srand() before each test (default 1)\0A -i\09Interactive mode: allow tests to ask for user input\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @die(i8* getelementptr inbounds ([436 x i8], [436 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [436 x i8] c"Usage: %s [-n] [-l] [-v] [-p <line prefix>] [-s seed] [<test>...]\0A -n\09No fork; run all tests in the same process (simpler for debugging)\0A -l\09List tests, but do not run them\0A -v\09Invert selection, only run or list tests not specified in the command\0A\09line.\0A -p\09Use the specified prefix instead of a tab on each line\0A -s\09Random seed used to seed srand() before each test (default 1)\0A -i\09Interactive mode: allow tests to ask for user input\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @die(i8* getelementptr inbounds ([436 x i8], [436 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ WRITETEST(char *);
void Index() { WRITETEST("\033D"); }


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

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

LLVM IR (-O0):
@.str = [3 x i8] c"\1BD\00"
define void @Index() {
%1 = call i32 @WRITETEST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\1BD\00"
define void @Index() {
%1 = tail call i32 @WRITETEST(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ get_tokenf(char *, char, char, char, char const *,
                              char const *);
char *tokenf(char B, char S, char C, const char *tok, const char *path) {
  static char buffer[1024];
  get_tokenf(buffer, B, S, C, tok, path);
  return buffer;
}


x86 assembly (clang, -O0):
<tokenf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    %rcx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    -0x1(%rbp),%dl
mov    -0x2(%rbp),%cl
mov    -0x3(%rbp),%al
mov    -0x10(%rbp),%r8
mov    -0x18(%rbp),%r9
lea    0x2ef6(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
call   1030 <get_tokenf@plt>
lea    0x2ee1(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tokenf>:
push   %rbx
mov    %r8,%r9
mov    %rcx,%r8
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
lea    0x2f1c(%rip),%rbx
mov    %rbx,%rdi
call   1030 <get_tokenf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@tokenf.buffer = internal global [1024 x i8] zeroinitializer
define i8* @tokenf(i8 signext %0, i8 signext %1, i8 signext %2, i8* %3, i8* %4) {
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i8*
store i8 %0, i8* %6
store i8 %1, i8* %7
store i8 %2, i8* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8, i8* %6
%12 = load i8, i8* %7
%13 = load i8, i8* %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @get_tokenf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @tokenf.buffer, i64 0, i64 0), i8 signext %11, i8 signext %12, i8 signext %13, i8* %14, i8* %15)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @tokenf.buffer, i64 0, i64 0)
}

LLVM IR (-O2):
@tokenf.buffer = internal global [1024 x i8] zeroinitializer
define i8* @tokenf(i8 signext %0, i8 signext %1, i8 signext %2, i8* %3, i8* %4) {
%6 = tail call i32 @get_tokenf(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @tokenf.buffer, i64 0, i64 0), i8 signext %0, i8 signext %1, i8 signext %2, i8* %3, i8* %4)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @tokenf.buffer, i64 0, i64 0)
}
void PrintA() {}


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

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

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

LLVM IR (-O2):
define void @PrintA() {
ret void
}
int dswap(int N, double *DX, int INCX, double *DY, int INCY) {
  extern int dswap_(int *N, double *DX, int *INCX, double *DY, int *INCY);
  return dswap_(&N, DX, &INCX, DY, &INCY);
}


x86 assembly (clang, -O0):
<dswap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rcx
lea    -0x4(%rbp),%rdi
lea    -0x14(%rbp),%rdx
lea    -0x24(%rbp),%r8
call   1030 <dswap_@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dswap>:
sub    $0x18,%rsp
mov    %edi,0x14(%rsp)
mov    %edx,0x10(%rsp)
mov    %r8d,0xc(%rsp)
lea    0x14(%rsp),%rdi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%r8
call   1030 <dswap_@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @dswap(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca double*
%8 = alloca i32
%9 = alloca double*
%10 = alloca i32
store i32 %0, i32* %6
store double* %1, double** %7
store i32 %2, i32* %8
store double* %3, double** %9
store i32 %4, i32* %10
%11 = load double*, double** %7
%12 = load double*, double** %9
%13 = call i32 @dswap_(i32* %6, double* %11, i32* %8, double* %12, i32* %10)
ret i32 %13
}

LLVM IR (-O2):
define i32 @dswap(i32 %0, double* %1, i32 %2, double* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %6
store i32 %2, i32* %7
store i32 %4, i32* %8
%9 = call i32 @dswap_(i32* %6, double* %1, i32* %7, double* %3, i32* %8)
ret i32 %9
}
int toint_d(double x) {
  int i;
  __asm__ __volatile__("cvttsd2si %1, %0" : "=r"(i) : "x"(x));
  return i;
}


x86 assembly (clang, -O0):
<toint_d>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toint_d>:
cvttsd2si %xmm0,%eax
ret

LLVM IR (-O0):
define i32 @toint_d(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = call i32 asm sideeffect "cvttsd2si $1, $0", "=r,x,~{dirflag},~{fpsr},~{flags}"(double %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @toint_d(double %0) {
%2 = tail call i32 asm sideeffect "cvttsd2si $1, $0", "=r,x,~{dirflag},~{fpsr},~{flags}"(double %0)
ret i32 %2
}
void save_rgb_config(void) {}


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

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

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

LLVM IR (-O2):
define void @save_rgb_config() {
ret void
}
/* Type definitions */
struct strbuf {
  int dummy;
};

/* Variables and functions */
int __compress__(struct strbuf *, struct strbuf *, int);
int compress_default(struct strbuf *src, struct strbuf *dest) {
  return __compress__(src, dest, 9);
}


x86 assembly (clang, -O0):
<compress_default>:
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 <__compress__@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.strbuf = type { i32 }
define i32 @compress_default(%struct.strbuf* %0, %struct.strbuf* %1) {
%3 = alloca %struct.strbuf*
%4 = alloca %struct.strbuf*
store %struct.strbuf* %0, %struct.strbuf** %3
store %struct.strbuf* %1, %struct.strbuf** %4
%5 = load %struct.strbuf*, %struct.strbuf** %3
%6 = load %struct.strbuf*, %struct.strbuf** %4
%7 = call i32 @__compress__(%struct.strbuf* %5, %struct.strbuf* %6, i32 9)
ret i32 %7
}

LLVM IR (-O2):
%struct.strbuf = type { i32 }
define i32 @compress_default(%struct.strbuf* %0, %struct.strbuf* %1) {
%3 = tail call i32 @__compress__(%struct.strbuf* %0, %struct.strbuf* %1, i32 9)
ret i32 %3
}
int test_imm_B1int16_mem(short *val) {
  return ((*val) & (-0xB1 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B1int16_mem>:
movzwl (%rdi),%eax
test   $0xff4f,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_B1int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -177
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int x;
  float y = 3.14;
  x = y;
  printf("x  = %d\n", x);
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [9 x i8] c"x = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
store float 0x40091EB860000000, float* %3
%4 = load float, float* %3
%5 = fptosi float %4 to i32
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"x = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 0
}
__attribute__((__always___)) int _xbegin_rtm(void) {
  int ret = (~0u);
  asm volatile(".byte 0xc7,0xf8 ; .long 0" : "+a"(ret)::"memory");
  return ret;
}


x86 assembly (clang, -O0):
<_xbegin_rtm>:
push   %rbp
mov    %rsp,%rbp
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xbegin 1114 <_xbegin_rtm+0x14>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xbegin_rtm>:
mov    $0xffffffff,%eax
xbegin 110b <_xbegin_rtm+0xb>
ret

LLVM IR (-O0):
define i32 @_xbegin_rtm() {
%1 = alloca i32
store i32 -1, i32* %1
%2 = load i32, i32* %1
%3 = call i32 asm sideeffect ".byte 0xc7,0xf8 ; .long 0", "={ax},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 %2)
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @_xbegin_rtm() {
%1 = tail call i32 asm sideeffect ".byte 0xc7,0xf8 ; .long 0", "={ax},0,~{memory},~{dirflag},~{fpsr},~{flags}"(i32 -1)
ret i32 %1
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int syscon_create_evaluator(void) {
  int fail, *a, *b;
  double *c;
  fail = _ada_use_c2phc4c(147, a, b, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_create_evaluator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x93,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscon_create_evaluator>:
mov    $0x93,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @syscon_create_evaluator() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca double*
%5 = load i32*, i32** %2
%6 = load i32*, i32** %3
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc4c(i32 147, i32* %5, i32* %6, double* %7, i32 0)
store i32 %8, i32* %1
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
define i32 @syscon_create_evaluator() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 147, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
void init(char **list) {
  int i;
  for (i = 0; i < 5; ++i)
    list[i] = (char *)&list[i];
}


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1142 <init+0x42>
mov    -0x8(%rbp),%rdx
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <init+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
mov    %rdi,(%rdi)
lea    0x8(%rdi),%rax
mov    %rax,0x8(%rdi)
lea    0x10(%rdi),%rax
mov    %rax,0x10(%rdi)
lea    0x18(%rdi),%rax
mov    %rax,0x18(%rdi)
lea    0x20(%rdi),%rax
mov    %rax,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @init(i8** %0) {
%2 = bitcast i8** %0 to i8***
store i8** %0, i8*** %2
%3 = getelementptr inbounds i8*, i8** %0, i64 1
%4 = bitcast i8** %3 to i8***
store i8** %3, i8*** %4
%5 = getelementptr inbounds i8*, i8** %0, i64 2
%6 = bitcast i8** %5 to i8***
store i8** %5, i8*** %6
%7 = getelementptr inbounds i8*, i8** %0, i64 3
%8 = bitcast i8** %7 to i8***
store i8** %7, i8*** %8
%9 = getelementptr inbounds i8*, i8** %0, i64 4
%10 = bitcast i8** %9 to i8***
store i8** %9, i8*** %10
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printUsage() {
  printf("Usage: reflector -p <reflector port> -s <hostname> -g <pinger port> "
         "-d <delay> -l <loss probability>\n");
}


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

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

LLVM IR (-O0):
@.str = [102 x i8] c"Usage: reflector -p <reflector port> -s <hostname> -g <pinger port> -d <delay> -l <loss probability>\0A\00"
define void @printUsage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([102 x i8], [102 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [101 x i8] c"Usage: reflector -p <reflector port> -s <hostname> -g <pinger port> -d <delay> -l <loss probability>\00"
define void @printUsage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([101 x i8], [101 x i8]* @str, i64 0, i64 0))
ret void
}
int get_stack(unsigned char *stack, int depth) {
  unsigned int offset = depth >> (4 - 1);
  return (stack[offset] >> (((depth & ~(255 << (4 - 1))) * 1))) & ~(255 << 1);
}


x86 assembly (clang, -O0):
<get_stack>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movzbl (%rax,%rcx,1),%eax
mov    -0xc(%rbp),%ecx
and    $0xfffff807,%ecx
shl    $0x0,%ecx
sar    %cl,%eax
and    $0xfffffe01,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_stack>:
mov    %esi,%ecx
mov    %esi,%eax
sar    $0x3,%eax
movzbl (%rdi,%rax,1),%eax
and    $0x7,%cl
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_stack(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 i32, i32* %4
%7 = ashr i32 %6, 3
store i32 %7, i32* %5
%8 = load i8*, i8** %3
%9 = load i32, i32* %5
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = load i32, i32* %4
%15 = and i32 %14, -2041
%16 = mul nsw i32 %15, 1
%17 = ashr i32 %13, %16
%18 = and i32 %17, -511
ret i32 %18
}

LLVM IR (-O2):
define i32 @get_stack(i8* nocapture %0, i32 %1) {
%3 = ashr i32 %1, 3
%4 = zext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = zext i8 %6 to i32
%8 = and i32 %1, -2041
%9 = lshr i32 %7, %8
%10 = and i32 %9, -511
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *security_sql_injection_escape(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
char *appaserver_user_primary_where(char *login_name) {
  static char where[128];
  char *tmp;
  sprintf(where, "login_name = '%s'",
          (tmp = security_sql_injection_escape(login_name)));
  free(tmp);
  return where;
}


x86 assembly (clang, -O0):
<appaserver_user_primary_where>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <security_sql_injection_escape@plt>
mov    %rax,%rdx
mov    %rdx,-0x10(%rbp)
lea    0x2efd(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
lea    0x2ee1(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appaserver_user_primary_where>:
push   %r14
push   %rbx
push   %rax
call   1040 <security_sql_injection_escape@plt>
mov    %rax,%rbx
lea    0x2f0d(%rip),%r14
lea    0xeb6(%rip),%rsi
mov    %r14,%rdi
mov    %rax,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@appaserver_user_primary_where.where = internal global [128 x i8] zeroinitializer
@.str = [18 x i8] c"login_name = '%s'\00"
define i8* @appaserver_user_primary_where(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @security_sql_injection_escape(i8* %4)
store i8* %5, i8** %3
%6 = call i32 @sprintf(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @appaserver_user_primary_where.where, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = call i32 @free(i8* %7)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @appaserver_user_primary_where.where, i64 0, i64 0)
}

LLVM IR (-O2):
@appaserver_user_primary_where.where = internal global [128 x i8] zeroinitializer
@.str = [18 x i8] c"login_name = '%s'\00"
define i8* @appaserver_user_primary_where(i8* %0) {
%2 = tail call i8* @security_sql_injection_escape(i8* %0)
%3 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([128 x i8], [128 x i8]* @appaserver_user_primary_where.where, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = tail call i32 @free(i8* %2)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @appaserver_user_primary_where.where, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ reverse(char *);
scalar_t__ ungetch(char);
void ungets(char s[]) {
  int i = 0;
  reverse(s);
  while (s[i] != '\0' && ungetch(s[i]))
    ++i;
}


x86 assembly (clang, -O0):
<ungets>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <reverse@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1171 <ungets+0x51>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <ungetch@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1181 <ungets+0x61>
jmp    118f <ungets+0x6f>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113c <ungets+0x1c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ungets>:
push   %rbx
mov    %rdi,%rbx
call   1030 <reverse@plt>
mov    (%rbx),%al
test   %al,%al
je     1158 <ungets+0x38>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsbl %al,%edi
call   1040 <ungetch@plt>
test   %rax,%rax
je     1158 <ungets+0x38>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <ungets+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ungets(i8* %0) {
%2 = tail call i32 @reverse(i8* %0)
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %9
5: ; preds = %9
%6 = getelementptr inbounds i8, i8* %0, i64 %14
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %1, %5
%10 = phi i64 [ %14, %5 ], [ 0, %1 ]
%11 = phi i8 [ %7, %5 ], [ %3, %1 ]
%12 = tail call i64 @ungetch(i8 signext %11)
%13 = icmp eq i64 %12, 0
%14 = add nuw i64 %10, 1
br i1 %13, label %15, label %5
15: ; preds = %9, %5, %1
ret void
}
int *odds(void) {
  static int o[5];
  int x;
  for (x = 0; x < 5; x++)
    o[x] = 2 * x + 1;
  return (o);
}


x86 assembly (clang, -O0):
<odds>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x5,-0x4(%rbp)
jge    113a <odds+0x3a>
mov    -0x4(%rbp),%edx
shl    $0x1,%edx
add    $0x1,%edx
movslq -0x4(%rbp),%rcx
lea    0x2f07(%rip),%rax
mov    %edx,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <odds+0xb>
lea    0x2eef(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<odds>:
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x2f22(%rip)
lea    0x2f1b(%rip),%rax
movl   $0x9,0x2f21(%rip)
ret

LLVM IR (-O0):
@odds.o = internal global [5 x i32] zeroinitializer
define i32* @odds() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %12, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 5
br i1 %4, label %5, label %15
5: ; preds = %2
%6 = load i32, i32* %1
%7 = mul nsw i32 2, %6
%8 = add nsw i32 %7, 1
%9 = load i32, i32* %1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i32], [5 x i32]* @odds.o, i64 0, i64 %10
store i32 %8, i32* %11
br label %12
12: ; preds = %5
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
br label %2
15: ; preds = %2
ret i32* getelementptr inbounds ([5 x i32], [5 x i32]* @odds.o, i64 0, i64 0)
}

LLVM IR (-O2):
@odds.o = internal global [5 x i32] zeroinitializer
define i32* @odds() {
store <4 x i32> <i32 1, i32 3, i32 5, i32 7>, <4 x i32>* bitcast ([5 x i32]* @odds.o to <4 x i32>*)
store i32 9, i32* getelementptr inbounds ([5 x i32], [5 x i32]* @odds.o, i64 0, i64 4)
ret i32* getelementptr inbounds ([5 x i32], [5 x i32]* @odds.o, i64 0, i64 0)
}