xunge/DecIR huggingface dataset:
int mystrncmp(unsigned char *str1, unsigned char *str2, int len) {
  while (len) {
    int d;
    if ((d = (int)*str1++ - (int)*str2++))
      return d;
    len--;
  }
  return 0;
}


x86 assembly (clang, -O0):
<mystrncmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1164 <mystrncmp+0x64>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movzbl (%rcx),%ecx
sub    %ecx,%eax
mov    %eax,-0x20(%rbp)
cmp    $0x0,%eax
je     1156 <mystrncmp+0x56>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116b <mystrncmp+0x6b>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    110f <mystrncmp+0xf>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mystrncmp>:
mov    %edx,%r8d
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %edx,%r8d
je     1126 <mystrncmp+0x26>
movzbl (%rdi,%rdx,1),%eax
movzbl (%rsi,%rdx,1),%ecx
add    $0x1,%rdx
sub    %ecx,%eax
je     1110 <mystrncmp+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @mystrncmp(i8* nocapture %0, i8* nocapture %1, i32 %2) {
br label %4
4: ; preds = %9, %3
%5 = phi i8* [ %0, %3 ], [ %10, %9 ]
%6 = phi i8* [ %1, %3 ], [ %13, %9 ]
%7 = phi i32 [ %2, %3 ], [ %18, %9 ]
%8 = icmp eq i32 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %5, i64 1
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = getelementptr inbounds i8, i8* %6, i64 1
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = sub nsw i32 %12, %15
%17 = icmp eq i32 %16, 0
%18 = add nsw i32 %7, -1
br i1 %17, label %4, label %19
19: ; preds = %9, %4
%20 = phi i32 [ %16, %9 ], [ 0, %4 ]
ret i32 %20
}
double foo07(double a, double b, double c) { return (a * b + c); }


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

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

LLVM IR (-O0):
define double @foo07(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = load double, double* %6
%10 = call double @llvm.fmuladd.f64(double %7, double %8, double %9)
ret double %10
}

LLVM IR (-O2):
define double @foo07(double %0, double %1, double %2) {
%4 = tail call double @llvm.fmuladd.f64(double %0, double %1, double %2)
ret double %4
}
int free_eth_mac(struct eth_mac *val) {}


x86 assembly (clang, -O0):
<free_eth_mac>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.eth_mac = type opaque
define i32 @free_eth_mac(%struct.eth_mac* %0) {
%2 = alloca i32
%3 = alloca %struct.eth_mac*
store %struct.eth_mac* %0, %struct.eth_mac** %3
%4 = load i32, i32* %2
ret i32 %4
}

LLVM IR (-O2):
%struct.eth_mac = type opaque
define i32 @free_eth_mac(%struct.eth_mac* nocapture readnone %0) {
ret i32 undef
}
int test_imm_28uint8_reg(unsigned char val) {
  return ((val) & (-0x28 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_28uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffffd8,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_28uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -40
%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_28uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, -40
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int floor(int);
int which(int in) { return floor(in / ((1 << 5) - 1)); }


x86 assembly (clang, -O0):
<which>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x1f,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <floor@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<which>:
movslq %edi,%rdi
imul   $0xffffffff84210843,%rdi,%rax
shr    $0x20,%rax
add    %eax,%edi
mov    %edi,%eax
shr    $0x1f,%eax
sar    $0x4,%edi
add    %eax,%edi
jmp    1030 <floor@plt>

LLVM IR (-O0):
define i32 @which(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sdiv i32 %3, 31
%5 = call i32 @floor(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @which(i32 %0) {
%2 = sdiv i32 %0, 31
%3 = tail call i32 @floor(i32 %2)
ret i32 %3
}
/* Type definitions */
struct sigstate {
  int dummy;
};
typedef int /*<<< orphan*/ siginfo_t;

/* Variables and functions */
int ENOSYS;
int sigstate_send(struct sigstate *data, int sig, const siginfo_t *info) {
  (void)data;
  (void)sig;
  (void)info;
  return -ENOSYS;
}


x86 assembly (clang, -O0):
<sigstate_send>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %eax,%eax
mov    0x2ed0(%rip),%rcx
sub    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sigstate_send>:
mov    0x2ee1(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
ret

LLVM IR (-O0):
%struct.sigstate = type { i32 }
@ENOSYS = global i32 0
define i32 @sigstate_send(%struct.sigstate* %0, i32 %1, i32* %2) {
%4 = alloca %struct.sigstate*
%5 = alloca i32
%6 = alloca i32*
store %struct.sigstate* %0, %struct.sigstate** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load %struct.sigstate*, %struct.sigstate** %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = load i32, i32* @ENOSYS
%11 = sub nsw i32 0, %10
ret i32 %11
}

LLVM IR (-O2):
%struct.sigstate = type { i32 }
@ENOSYS = global i32 0
define i32 @sigstate_send(%struct.sigstate* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
%5 = sub nsw i32 0, %4
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_srai_pi16(int /*<<< orphan*/, int);
__m64 test73(__m64 a) { return _mm_srai_pi16(a, 3); }


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

x86 assembly (clang, -O2):
<test73>:
mov    $0x3,%esi
jmp    1030 <_mm_srai_pi16@plt>

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

LLVM IR (-O2):
define i32 @test73(i32 %0) {
%2 = tail call i32 @_mm_srai_pi16(i32 %0, i32 3)
ret i32 %2
}
void *block_for_user_ptr(void *uptr) { return ((char *)uptr) - (0); }


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

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

LLVM IR (-O0):
define i8* @block_for_user_ptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
ret i8* %4
}

LLVM IR (-O2):
define i8* @block_for_user_ptr(i8* readnone returned %0) {
ret i8* %0
}
void trap_init(void) { return; }


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

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

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

LLVM IR (-O2):
define void @trap_init() {
ret void
}
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  {
    state[0UL] = (input[0UL] + 51238316UL) + (unsigned short)8426;
    if ((state[0UL] >> (unsigned short)4) & (unsigned short)1) {
      state[0UL] += state[0UL];
    }
    output[0UL] = (state[0UL] - 515147141UL) * (unsigned short)26375;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%eax
add    $0x30dd5ac,%rax
add    $0x20ea,%rax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
sar    $0x4,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1144 <RandomFunc+0x44>
movzwl -0x12(%rbp),%ecx
movzwl -0x12(%rbp),%eax
add    %ecx,%eax
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
sub    $0x1eb48585,%rax
imul   $0x6707,%rax,%rax
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
movzwl (%rdi),%eax
add    $0xfffff696,%eax
mov    %eax,%ecx
shr    $0x4,%cl
and    $0x1,%cl
shl    %cl,%eax
imul   $0x6707,%eax,%eax
add    $0xffffd65d,%eax
mov    %ax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i16* %0, i16* %1) {
%3 = alloca i16*
%4 = alloca i16*
%5 = alloca [1 x i16]
store i16* %0, i16** %3
store i16* %1, i16** %4
%6 = load i16*, i16** %3
%7 = getelementptr inbounds i16, i16* %6, i64 0
%8 = load i16, i16* %7
%9 = zext i16 %8 to i64
%10 = add i64 %9, 51238316
%11 = add i64 %10, 8426
%12 = trunc i64 %11 to i16
%13 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
store i16 %12, i16* %13
%14 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%15 = load i16, i16* %14
%16 = zext i16 %15 to i32
%17 = ashr i32 %16, 4
%18 = and i32 %17, 1
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %29
20: ; preds = %2
%21 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%22 = load i16, i16* %21
%23 = zext i16 %22 to i32
%24 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%25 = load i16, i16* %24
%26 = zext i16 %25 to i32
%27 = add nsw i32 %26, %23
%28 = trunc i32 %27 to i16
store i16 %28, i16* %24
br label %29
29: ; preds = %20, %2
%30 = getelementptr inbounds [1 x i16], [1 x i16]* %5, i64 0, i64 0
%31 = load i16, i16* %30
%32 = zext i16 %31 to i64
%33 = sub i64 %32, 515147141
%34 = mul i64 %33, 26375
%35 = trunc i64 %34 to i16
%36 = load i16*, i16** %4
%37 = getelementptr inbounds i16, i16* %36, i64 0
store i16 %35, i16* %37
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = load i16, i16* %0
%4 = add i16 %3, -2410
%5 = lshr i16 %4, 4
%6 = and i16 %5, 1
%7 = shl i16 %4, %6
%8 = mul i16 %7, 26375
%9 = add i16 %8, -10659
store i16 %9, i16* %1
ret void
}
unsigned xrop3_105_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = D ^ S;
  stk1 = T ^ stk2;
  stk1 = ~stk1;
  return stk1;
}


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

x86 assembly (clang, -O2):
<xrop3_105_0_0>:
mov    %edi,%ecx
shl    $0x8,%ecx
or     %edi,%ecx
mov    %esi,%eax
shl    $0x8,%eax
or     %esi,%eax
xor    %ecx,%eax
xor    $0xffffff00,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_105_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %4, %6
%8 = xor i32 %7, -256
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void print_test_status(int code, char *test_name) {
  printf("test return code: %d (%s)\n", code, test_name);
}


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

x86 assembly (clang, -O2):
<print_test_status>:
mov    %rsi,%rdx
mov    %edi,%esi
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"test return code: %d (%s)\0A\00"
define void @print_test_status(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %5, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"test return code: %d (%s)\0A\00"
define void @print_test_status(i32 %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1)
ret void
}
float check1(float x) { return __builtin_copysignf(x, 1.0); }


x86 assembly (clang, -O0):
<check1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movaps 0xeeb(%rip),%xmm1
pand   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<check1>:
andps  0xef9(%rip),%xmm0
ret

LLVM IR (-O0):
define float @check1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @llvm.copysign.f32(float %3, float 1.000000e+00)
ret float %4
}

LLVM IR (-O2):
define float @check1(float %0) {
%2 = tail call float @llvm.fabs.f32(float %0)
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ PrintMenu();
int /*<<< orphan*/ SelectMethod(int);
int /*<<< orphan*/ scanf(char *, int *);
void TestAll() {
  int choice;
  do {
    PrintMenu();
    scanf("%d", &choice);
    if (choice != 0)
      SelectMethod(choice);
  } while (choice != 0);
}


x86 assembly (clang, -O0):
<TestAll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <PrintMenu@plt>
lea    0xeba(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
cmpl   $0x0,-0x4(%rbp)
je     1161 <TestAll+0x31>
mov    -0x4(%rbp),%edi
call   1040 <SelectMethod@plt>
jmp    1166 <TestAll+0x36>
cmpl   $0x0,-0x4(%rbp)
jne    1138 <TestAll+0x8>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TestAll>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
lea    0x4(%rsp),%rbx
xor    %eax,%eax
call   1050 <PrintMenu@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%edi
test   %edi,%edi
je     1166 <TestAll+0x36>
call   1040 <SelectMethod@plt>
cmpl   $0x0,0x4(%rsp)
jne    1140 <TestAll+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @TestAll() {
%1 = alloca i32
br label %2
2: ; preds = %11, %0
%3 = call i32 (...) @PrintMenu()
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = call i32 @SelectMethod(i32 %8)
br label %10
10: ; preds = %7, %2
br label %11
11: ; preds = %10
%12 = load i32, i32* %1
%13 = icmp ne i32 %12, 0
br i1 %13, label %2, label %14
14: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @TestAll() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %8, %0
%4 = call i32 (...) @PrintMenu()
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = icmp eq i32 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %3
%9 = call i32 @SelectMethod(i32 %6)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %3
12: ; preds = %3, %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
unsigned long FanChannelStatus(unsigned long ulBase, unsigned long ulChannel) {
  DEBUG_ASSERT(ulBase == 0x40084000);
  DEBUG_ASSERT(ulChannel < 6);
  return (((*((volatile unsigned long *)(ulBase + 0x00000000))) >>
           (ulChannel * 2)) &
          0x00000003);
}


x86 assembly (clang, -O0):
<FanChannelStatus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x40084000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
cmpq   $0x6,-0x10(%rbp)
setb   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
shl    $0x1,%rcx
shr    %cl,%rax
and    $0x3,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FanChannelStatus>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
xor    %edi,%edi
cmp    $0x40084000,%r14
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
xor    %edi,%edi
cmp    $0x6,%rbx
setb   %dil
call   1030 <DEBUG_ASSERT@plt>
mov    (%r14),%rax
add    %ebx,%ebx
mov    %ebx,%ecx
shr    %cl,%rax
and    $0x3,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @FanChannelStatus(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 1074282496
%7 = zext i1 %6 to i32
%8 = call i32 @DEBUG_ASSERT(i32 %7)
%9 = load i64, i64* %4
%10 = icmp ult i64 %9, 6
%11 = zext i1 %10 to i32
%12 = call i32 @DEBUG_ASSERT(i32 %11)
%13 = load i64, i64* %3
%14 = add i64 %13, 0
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
%17 = load i64, i64* %4
%18 = mul i64 %17, 2
%19 = lshr i64 %16, %18
%20 = and i64 %19, 3
ret i64 %20
}

LLVM IR (-O2):
define i64 @FanChannelStatus(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, 1074282496
%4 = zext i1 %3 to i32
%5 = tail call i32 @DEBUG_ASSERT(i32 %4)
%6 = icmp ult i64 %1, 6
%7 = zext i1 %6 to i32
%8 = tail call i32 @DEBUG_ASSERT(i32 %7)
%9 = inttoptr i64 %0 to i64*
%10 = load volatile i64, i64* %9
%11 = shl i64 %1, 1
%12 = lshr i64 %10, %11
%13 = and i64 %12, 3
ret i64 %13
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ reach_error();
int main() {
  int a, b;
  int *p1 = &a;
  int *p2 = &b;
  if (p1 == p2) {
    goto ERROR;
  }
  return 0;
ERROR : {
  reach_error();
  abort();
}
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    1152 <main+0x32>
jmp    115a <main+0x3a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
mov    $0x0,%al
call   1040 <reach_error@plt>
mov    $0x0,%al
call   1030 <abort@plt>

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* %2, i32** %4
store i32* %3, i32** %5
%6 = load i32*, i32** %4
%7 = load i32*, i32** %5
%8 = icmp eq i32* %6, %7
br i1 %8, label %9, label %10
9: ; preds = %0
br label %11
10: ; preds = %0
ret i32 0
11: ; preds = %9
%12 = call i32 (...) @reach_error()
%13 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ unmap_flash(struct flashrom_flashctx *const);
void finalize_flash_access(struct flashrom_flashctx *const flash) {
  unmap_flash(flash);
}


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

x86 assembly (clang, -O2):
<finalize_flash_access>:
jmp    1030 <unmap_flash@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define void @finalize_flash_access(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
%3 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%4 = call i32 @unmap_flash(%struct.flashrom_flashctx* %3)
ret void
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define void @finalize_flash_access(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @unmap_flash(%struct.flashrom_flashctx* %0)
ret void
}
/* Variables and functions */
int rand();
int random_int_between(int upper, int lower) {
  if (upper < lower) {
    int tmp = upper;
    upper = lower;
    lower = tmp;
  }
  return rand() % (upper - lower + 1) + lower;
}


x86 assembly (clang, -O0):
<random_int_between>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    113c <random_int_between+0x2c>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
mov    -0x4(%rbp),%ecx
sub    -0x8(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_int_between>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
cmp    %esi,%edi
mov    %esi,%ebp
cmovl  %edi,%ebp
cmovl  %esi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
cltd
idiv   %ebx
add    %edx,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @random_int_between(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* %3
%7 = load i32, i32* %4
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load i32, i32* %3
store i32 %10, i32* %5
%11 = load i32, i32* %4
store i32 %11, i32* %3
%12 = load i32, i32* %5
store i32 %12, i32* %4
br label %13
13: ; preds = %9, %2
%14 = call i32 (...) @rand()
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = sub nsw i32 %15, %16
%18 = add nsw i32 %17, 1
%19 = srem i32 %14, %18
%20 = load i32, i32* %4
%21 = add nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @random_int_between(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
%5 = select i1 %3, i32 %1, i32 %0
%6 = tail call i32 (...) @rand()
%7 = sub i32 1, %4
%8 = add i32 %7, %5
%9 = srem i32 %6, %8
%10 = add nsw i32 %9, %4
ret i32 %10
}
int do_988() { return 988; }


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

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

LLVM IR (-O0):
define i32 @do_988() {
ret i32 988
}

LLVM IR (-O2):
define i32 @do_988() {
ret i32 988
}
int read_in(struct stats_pwr_in *st_pwr_in, int nr_alloc) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.stats_pwr_in = type opaque
define i32 @read_in(%struct.stats_pwr_in* nocapture readnone %0, i32 %1) {
ret i32 0
}
char *ch(char *buf, char *end, char ch) {
  if (buf <= end)
    *buf = ch;
  return buf + 1;
}


x86 assembly (clang, -O0):
<ch>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
ja     1128 <ch+0x28>
mov    -0x11(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ch>:
mov    %rdi,%rax
cmp    %rsi,%rdi
ja     110a <ch+0xa>
mov    %dl,(%rax)
add    $0x1,%rax
ret

LLVM IR (-O0):
define i8* @ch(i8* %0, i8* %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8 %2, i8* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = icmp ule i8* %7, %8
br i1 %9, label %10, label %13
10: ; preds = %3
%11 = load i8, i8* %6
%12 = load i8*, i8** %4
store i8 %11, i8* %12
br label %13
13: ; preds = %10, %3
%14 = load i8*, i8** %4
%15 = getelementptr inbounds i8, i8* %14, i64 1
ret i8* %15
}

LLVM IR (-O2):
define i8* @ch(i8* writeonly %0, i8* readnone %1, i8 signext %2) {
%4 = icmp ugt i8* %0, %1
br i1 %4, label %6, label %5
5: ; preds = %3
store i8 %2, i8* %0
br label %6
6: ; preds = %5, %3
%7 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %7
}
/* Variables and functions */
int /*<<< orphan*/ deltaDeallocatorOutput();
void deltaDeallocator() { deltaDeallocatorOutput(); }


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

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

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

LLVM IR (-O2):
define void @deltaDeallocator() {
%1 = tail call i32 (...) @deltaDeallocatorOutput()
ret void
}
/* Type definitions */
struct stat {
  int st_mode;
};

/* Variables and functions */
int S_IFDIR;
scalar_t__ stat(char const *, struct stat *);
int isDir(const char *path) {
  struct stat s;
  if (stat(path, &s) == 0) {
    if (s.st_mode & S_IFDIR) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<isDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <stat@plt>
cmp    $0x0,%rax
jne    1159 <isDir+0x49>
mov    -0x18(%rbp),%eax
mov    0x2e9b(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1154 <isDir+0x44>
movl   $0x1,-0x4(%rbp)
jmp    1160 <isDir+0x50>
jmp    1159 <isDir+0x49>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDir>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
test   %rax,%rax
jne    1133 <isDir+0x23>
mov    0x2eb3(%rip),%rax
mov    (%rax),%ecx
mov    $0x1,%eax
test   %ecx,(%rsp)
je     1133 <isDir+0x23>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @isDir(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca %struct.stat
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @stat(i8* %5, %struct.stat* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%10 = load i32, i32* %9
%11 = load i32, i32* @S_IFDIR
%12 = and i32 %10, %11
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %8
store i32 1, i32* %2
br label %17
15: ; preds = %8
br label %16
16: ; preds = %15, %1
store i32 0, i32* %2
br label %17
17: ; preds = %16, %14
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
%struct.stat = type { i32 }
@S_IFDIR = global i32 0
define i32 @isDir(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* @S_IFDIR
%10 = and i32 %9, %8
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %6, %1
br label %13
13: ; preds = %6, %12
%14 = phi i32 [ 0, %12 ], [ 1, %6 ]
ret i32 %14
}
/* Variables and functions */
scalar_t__ ceil(int);
int log(int);
int binary(int N) { return (int)ceil(log(N + 1) / log(2)); }


x86 assembly (clang, -O0):
<binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
call   1040 <log@plt>
mov    %eax,-0x8(%rbp)
mov    $0x2,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
cltd
idiv   %ecx
mov    %eax,%edi
call   1030 <ceil@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<binary>:
push   %rbx
add    $0x1,%edi
call   1040 <log@plt>
mov    %eax,%ebx
mov    $0x2,%edi
call   1040 <log@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%edi
pop    %rbx
jmp    1030 <ceil@plt>

LLVM IR (-O0):
define i32 @binary(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = call i32 @log(i32 %4)
%6 = call i32 @log(i32 2)
%7 = sdiv i32 %5, %6
%8 = call i64 @ceil(i32 %7)
%9 = trunc i64 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @binary(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = tail call i32 @log(i32 %2)
%4 = tail call i32 @log(i32 2)
%5 = sdiv i32 %3, %4
%6 = tail call i64 @ceil(i32 %5)
%7 = trunc i64 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("usage: todo-completion\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [24 x i8] c"usage: todo-completion\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [23 x i8] c"usage: todo-completion\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ is_hex(char *);
char *is_hex_01c() {
  char hex[] =
      "B300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3";
  do {
    if (!(is_hex(hex)))
      return "return true for hex strings without leading '0x's";
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<is_hex_01c>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    -0x50(%rbp),%rdi
lea    0xecd(%rip),%rsi
mov    $0x41,%edx
call   1040 <memcpy@plt>
lea    -0x50(%rbp),%rdi
call   1030 <is_hex@plt>
cmp    $0x0,%eax
jne    115f <is_hex_01c+0x3f>
lea    0xeeb(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    116c <is_hex_01c+0x4c>
jmp    1164 <is_hex_01c+0x44>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hex_01c>:
sub    $0x48,%rsp
movaps 0xf15(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xef9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xedd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec1(%rip),%xmm0
movaps %xmm0,(%rsp)
movb   $0x0,0x40(%rsp)
mov    %rsp,%rdi
call   1030 <is_hex@plt>
xor    %ecx,%ecx
test   %eax,%eax
lea    0xee6(%rip),%rax
cmove  %rax,%rcx
mov    %rcx,%rax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.is_hex_01c.hex = [65 x i8] c"B300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3\00"
@.str = [50 x i8] c"return true for hex strings without leading '0x's\00"
define i8* @is_hex_01c() {
%1 = alloca i8*
%2 = alloca [65 x i8]
%3 = bitcast [65 x i8]* %2 to i8*
br label %4
4: ; preds = %0
%5 = getelementptr inbounds [65 x i8], [65 x i8]* %2, i64 0, i64 0
%6 = call i32 @is_hex(i8* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %4
store i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8** %1
br label %11
9: ; preds = %4
br label %10
10: ; preds = %9
store i8* null, i8** %1
br label %11
11: ; preds = %10, %8
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@__const.is_hex_01c.hex = [65 x i8] c"B300562F8F9A961E158BDE2D4CCD2A64BB1D923208939714675BFFB17BBAF2A3\00"
@.str = [50 x i8] c"return true for hex strings without leading '0x's\00"
define i8* @is_hex_01c() {
%1 = alloca [65 x i8]
%2 = getelementptr inbounds [65 x i8], [65 x i8]* %1, i64 0, i64 0
%3 = call i32 @is_hex(i8* %2)
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* null
ret i8* %5
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i1;
  char num[123];
  printf("enter the number ");
  gets(num);
  i1 = atoi(num);
  printf("the number in after conversion from string to int is %d", i1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x90(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x90(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x80,%rsp
lea    0xec1(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
call   1050 <atoi@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"enter the number \00"
@.str.1 = [56 x i8] c"the number in after conversion from string to int is %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [123 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [123 x i8], [123 x i8]* %3, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
%7 = getelementptr inbounds [123 x i8], [123 x i8]* %3, i64 0, i64 0
%8 = call i32 @atoi(i8* %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"enter the number \00"
@.str.1 = [56 x i8] c"the number in after conversion from string to int is %d\00"
define i32 @main() {
%1 = alloca [123 x i8]
%2 = getelementptr inbounds [123 x i8], [123 x i8]* %1, i64 0, i64 0
%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 @gets(i8* %2)
%5 = call i32 @atoi(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
void fiat_p384_nonzero(uint64_t *out1, const uint64_t arg1[6]) {
  uint64_t x1;
  x1 = ((arg1[0]) |
        ((arg1[1]) | ((arg1[2]) | ((arg1[3]) | ((arg1[4]) | (arg1[5]))))));
  *out1 = x1;
}


x86 assembly (clang, -O0):
<fiat_p384_nonzero>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
mov    -0x10(%rbp),%rdx
mov    0x8(%rdx),%edx
mov    -0x10(%rbp),%rsi
mov    0xc(%rsi),%esi
mov    -0x10(%rbp),%rdi
mov    0x10(%rdi),%edi
mov    -0x10(%rbp),%r8
or     0x14(%r8),%edi
or     %edi,%esi
or     %esi,%edx
or     %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fiat_p384_nonzero>:
mov    0x4(%rsi),%eax
or     (%rsi),%eax
or     0x8(%rsi),%eax
or     0xc(%rsi),%eax
or     0x10(%rsi),%eax
or     0x14(%rsi),%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @fiat_p384_nonzero(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 = getelementptr inbounds i32, i32* %6, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = load i32*, i32** %4
%13 = getelementptr inbounds i32, i32* %12, i64 2
%14 = load i32, i32* %13
%15 = load i32*, i32** %4
%16 = getelementptr inbounds i32, i32* %15, i64 3
%17 = load i32, i32* %16
%18 = load i32*, i32** %4
%19 = getelementptr inbounds i32, i32* %18, i64 4
%20 = load i32, i32* %19
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i64 5
%23 = load i32, i32* %22
%24 = or i32 %20, %23
%25 = or i32 %17, %24
%26 = or i32 %14, %25
%27 = or i32 %11, %26
%28 = or i32 %8, %27
store i32 %28, i32* %5
%29 = load i32, i32* %5
%30 = load i32*, i32** %3
store i32 %29, i32* %30
ret void
}

LLVM IR (-O2):
define void @fiat_p384_nonzero(i32* nocapture writeonly %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = getelementptr inbounds i32, i32* %1, i64 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %1, i64 2
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 3
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %1, i64 4
%11 = load i32, i32* %10
%12 = getelementptr inbounds i32, i32* %1, i64 5
%13 = load i32, i32* %12
%14 = or i32 %5, %3
%15 = or i32 %14, %7
%16 = or i32 %15, %9
%17 = or i32 %16, %11
%18 = or i32 %17, %13
store i32 %18, i32* %0
ret void
}
/* Variables and functions */
int strlen(char const *);
void strip_marker(char *s, const char *targ) {
  int i, n = strlen(targ);
  for (i = 0; i < n; i++) {
    s[i] = ' ';
  }
}


x86 assembly (clang, -O0):
<strip_marker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1159 <strip_marker+0x49>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x20,(%rax,%rcx,1)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1133 <strip_marker+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_marker>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    113f <strip_marker+0x1f>
mov    %eax,%edx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <memset@plt>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @strip_marker(i8* nocapture writeonly %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = zext i32 %3 to i64
br label %7
7: ; preds = %5, %2
ret void
}
/* Variables and functions */
int _shm(char *);
int main(int argc, char *argv[]) {
  (void)argc;
  return _shm(argv[0]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1030 <_shm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    (%rsi),%rdi
jmp    1030 <_shm@plt>

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
%6 = load i32, i32* %4
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 0
%9 = load i8*, i8** %8
%10 = call i32 @_shm(i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @_shm(i8* %3)
ret i32 %4
}
void int_enc(void *buf, int val) { *((int *)buf) = val; }


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

x86 assembly (clang, -O2):
<int_enc>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @int_enc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to i32*
store i32 %5, i32* %7
ret void
}

LLVM IR (-O2):
define void @int_enc(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long backing_pixel;
};
typedef TYPE_1__ XSetWindowAttributes;

/* Variables and functions */
void set_XSetWindowAttributes_backing_pixel(void *_p, unsigned long _v) {
  ((XSetWindowAttributes *)_p)->backing_pixel = (unsigned long)_v;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define void @set_XSetWindowAttributes_backing_pixel(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = load i8*, i8** %3
%7 = bitcast i8* %6 to %struct.TYPE_2__*
%8 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %7, i32 0, i32 0
store i64 %5, i64* %8
ret void
}

LLVM IR (-O2):
define void @set_XSetWindowAttributes_backing_pixel(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int M_PI;
float pixel2lon(int zoom, int pixel_x) {
  return ((pixel_x - ((1 << zoom) * (256 / 2))) * 2 * M_PI) /
         (256 * (1 << zoom));
}


x86 assembly (clang, -O0):
<pixel2lon>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
shl    $0x7,%ecx
sub    %ecx,%eax
shl    $0x1,%eax
mov    0x2ec0(%rip),%rcx
imul   (%rcx),%eax
mov    -0x4(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
shl    $0x8,%ecx
cltd
idiv   %ecx
cvtsi2ss %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pixel2lon>:
mov    %edi,%ecx
mov    $0xffffff80,%eax
shl    %cl,%eax
add    %esi,%eax
mov    0x2ed6(%rip),%rdx
imul   (%rdx),%eax
add    %eax,%eax
mov    $0x100,%esi
shl    %cl,%esi
cltd
idiv   %esi
cvtsi2ss %eax,%xmm0
ret

LLVM IR (-O0):
@M_PI = global i32 0
define float @pixel2lon(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = shl i32 1, %6
%8 = mul nsw i32 %7, 128
%9 = sub nsw i32 %5, %8
%10 = mul nsw i32 %9, 2
%11 = load i32, i32* @M_PI
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %3
%14 = shl i32 1, %13
%15 = mul nsw i32 256, %14
%16 = sdiv i32 %12, %15
%17 = sitofp i32 %16 to float
ret float %17
}

LLVM IR (-O2):
@M_PI = global i32 0
define float @pixel2lon(i32 %0, i32 %1) {
%3 = shl i32 -128, %0
%4 = add i32 %3, %1
%5 = shl nsw i32 %4, 1
%6 = load i32, i32* @M_PI
%7 = mul nsw i32 %5, %6
%8 = shl nuw i32 256, %0
%9 = sdiv i32 %7, %8
%10 = sitofp i32 %9 to float
ret float %10
}
char *dname(name)
register char *name;
{
  register char *p;
  p = name;
  while (*p)
    if (*p++ == '/' && *p)
      name = p;
  return name;
}


x86 assembly (clang, -O0):
<dname>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1155 <dname+0x55>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    1150 <dname+0x50>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1150 <dname+0x50>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <dname+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dname>:
mov    %rdi,%rax
mov    (%rdi),%sil
test   %sil,%sil
je     112e <dname+0x2e>
lea    0x1(%rax),%rcx
nop
movzbl (%rcx),%edx
test   %dl,%dl
mov    %rcx,%rdi
cmove  %rax,%rdi
cmp    $0x2f,%sil
cmove  %rdi,%rax
add    $0x1,%rcx
mov    %edx,%esi
test   %dl,%dl
jne    1110 <dname+0x10>
ret

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

LLVM IR (-O2):
define i8* @dname(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i8* [ %13, %4 ], [ %0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = icmp eq i8 %5, 47
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
%12 = select i1 %11, i8* %7, i8* %8
%13 = select i1 %9, i8* %12, i8* %7
%14 = icmp eq i8 %10, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i8* [ %0, %1 ], [ %13, %4 ]
ret i8* %16
}