xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x5f() {
  Assert_real((isalnum(95) == 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_isalnum.c",
              480, ("isalnum should be 0 for _"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x5f>:
push   %rax
mov    $0x5f,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x1e0,%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_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for _\00"
define void @t_isalnum_0x5f() {
%1 = call i64 @isalnum(i32 95)
%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 480, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isalnum.c\00"
@.str.1 = [26 x i8] c"isalnum should be 0 for _\00"
define void @t_isalnum_0x5f() {
%1 = tail call i64 @isalnum(i32 95)
%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 480, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ left_rotate32();
int main() {
  left_rotate32();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <left_rotate32@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <left_rotate32@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @left_rotate32()
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @left_rotate32()
%2 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ report_error(long);
int /*<<< orphan*/ stderr;
void parsing_error(long line_counter) {
  report_error(line_counter);
  fprintf(stderr, "Parsing problems\n");
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<parsing_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <report_error@plt>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
lea    0xeab(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<parsing_error>:
push   %rax
call   1040 <report_error@plt>
mov    0x2ea3(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"Parsing problems\0A\00"
@EXIT_FAILURE = global i32 0
define void @parsing_error(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @report_error(i64 %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"Parsing problems\0A\00"
@EXIT_FAILURE = global i32 0
define void @parsing_error(i64 %0) {
%2 = tail call i32 @report_error(i64 %0)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ scrprintf(char *, int);
void csrdn(int n) { scrprintf("\033[%dB", n); }


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

x86 assembly (clang, -O2):
<csrdn>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <scrprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"\1B[%dB\00"
define void @csrdn(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @scrprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"\1B[%dB\00"
define void @csrdn(i32 %0) {
%2 = tail call i32 @scrprintf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Type definitions */
struct timeval {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dtimer(double *, struct timeval *, int);
void dtimer_(double *time, unsigned long *itime, int *icntrl) {
  dtimer(time, (struct timeval *)itime, *icntrl);
  return;
}


x86 assembly (clang, -O0):
<dtimer_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
call   1030 <dtimer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dtimer_>:
mov    (%rdx),%edx
jmp    1030 <dtimer@plt>

LLVM IR (-O0):
%struct.timeval = type { i32 }
define void @dtimer_(double* %0, i64* %1, i32* %2) {
%4 = alloca double*
%5 = alloca i64*
%6 = alloca i32*
store double* %0, double** %4
store i64* %1, i64** %5
store i32* %2, i32** %6
%7 = load double*, double** %4
%8 = load i64*, i64** %5
%9 = bitcast i64* %8 to %struct.timeval*
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = call i32 @dtimer(double* %7, %struct.timeval* %9, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
define void @dtimer_(double* %0, i64* %1, i32* nocapture %2) {
%4 = bitcast i64* %1 to %struct.timeval*
%5 = load i32, i32* %2
%6 = tail call i32 @dtimer(double* %0, %struct.timeval* %4, i32 %5)
ret void
}
int isSpace(int c) { return c == ' ' || c == '\t' || c == '\n'; }


x86 assembly (clang, -O0):
<isSpace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <isSpace+0x2f>
mov    $0x1,%al
cmpl   $0x9,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     112f <isSpace+0x2f>
cmpl   $0xa,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSpace>:
mov    $0x1,%eax
cmp    $0x9,%edi
je     110f <isSpace+0xf>
cmp    $0x20,%edi
jne    1110 <isSpace+0x10>
ret
xor    %eax,%eax
cmp    $0xa,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isSpace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %11, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br i1 %7, label %11, label %8
8: ; preds = %5
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 10
br label %11
11: ; preds = %8, %5, %1
%12 = phi i1 [ true, %5 ], [ true, %1 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @isSpace(i32 %0) {
switch i32 %0, label %2 [
i32 32, label %5
i32 9, label %5
]
2: ; preds = %1
%3 = icmp eq i32 %0, 10
%4 = zext i1 %3 to i32
br label %5
5: ; preds = %1, %1, %2
%6 = phi i32 [ 1, %1 ], [ %4, %2 ], [ 1, %1 ]
ret i32 %6
}
int bitset_cb(void *arg, unsigned size, void *dummy, void *data) {
  unsigned *total = arg;
  *total += size;
  return 0;
}


x86 assembly (clang, -O0):
<bitset_cb>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x28(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bitset_cb>:
add    %esi,(%rdi)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @bitset_cb(i8* %0, i32 %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %9
%12 = load i32, i32* %6
%13 = load i32*, i32** %9
%14 = load i32, i32* %13
%15 = add i32 %14, %12
store i32 %15, i32* %13
ret i32 0
}

LLVM IR (-O2):
define i32 @bitset_cb(i8* nocapture %0, i32 %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
%5 = bitcast i8* %0 to i32*
%6 = load i32, i32* %5
%7 = add i32 %6, %1
store i32 %7, i32* %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__6__IO__clr();
void Msp430GpioC__13__HplGeneralIO__clr(void) {
  HplMsp430GeneralIOP__6__IO__clr();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__13__HplGeneralIO__clr() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__6__IO__clr()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ __m128d;

/* Variables and functions */
int /*<<< orphan*/ _mm_cmpgt_pd(int /*<<< orphan*/, int /*<<< orphan*/);
__m128d test_mm_cmpgt_pd(__m128d A, __m128d B) { return _mm_cmpgt_pd(A, B); }


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

x86 assembly (clang, -O2):
<test_mm_cmpgt_pd>:
jmp    1030 <_mm_cmpgt_pd@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cmpgt_pd(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cmpgt_pd(i32 %0, i32 %1)
ret i32 %3
}
int see_wall(dir, y, x)
int dir, y, x;
{
  char c;
  if (!mmove(dir, &y, &x))
    return 1;
  else if ((c = loc_symbol(y, x)) == '#' || c == '%')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<see_wall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%edi
lea    -0xc(%rbp),%rsi
lea    -0x10(%rbp),%rdx
mov    $0x0,%al
call   1030 <mmove@plt>
cmp    $0x0,%eax
jne    1158 <see_wall+0x38>
movl   $0x1,-0x4(%rbp)
jmp    1194 <see_wall+0x74>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    $0x0,%al
call   1040 <loc_symbol@plt>
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x23,%eax
je     1181 <see_wall+0x61>
movsbl -0x11(%rbp),%eax
cmp    $0x25,%eax
jne    118d <see_wall+0x6d>
movl   $0x1,-0x4(%rbp)
jmp    1194 <see_wall+0x74>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<see_wall>:
push   %rax
mov    %esi,0x4(%rsp)
mov    %edx,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
xor    %eax,%eax
call   1030 <mmove@plt>
test   %eax,%eax
je     1161 <see_wall+0x41>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
xor    %eax,%eax
call   1040 <loc_symbol@plt>
mov    %eax,%ecx
shl    $0x18,%ecx
add    $0xdd000000,%ecx
xor    %eax,%eax
test   $0xfd000000,%ecx
sete   %al
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @see_wall(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
store i32 %1, i32* %4
store i32 %2, i32* %5
%6 = call i32 (i32, i32*, i32*, ...) bitcast (i32 (...)* @mmove to i32 (i32, i32*, i32*, ...)*)(i32 %0, i32* %4, i32* %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %17, label %8
8: ; preds = %3
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 (i32, i32, ...) bitcast (i32 (...)* @loc_symbol to i32 (i32, i32, ...)*)(i32 %9, i32 %10)
%12 = shl i32 %11, 24
%13 = icmp eq i32 %12, 620756992
%14 = icmp eq i32 %12, 587202560
%15 = or i1 %13, %14
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %8, %3
%18 = phi i32 [ 1, %3 ], [ %16, %8 ]
ret i32 %18
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigfillset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void block_signals(void) {
  sigset_t mask;
  sigfillset(&mask);
  sigprocmask(SIG_BLOCK, &mask, NULL);
}


x86 assembly (clang, -O0):
<block_signals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1040 <sigfillset@plt>
mov    0x2ea8(%rip),%rax
mov    (%rax),%edi
lea    -0x4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<block_signals>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <sigfillset@plt>
mov    0x2ea7(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define void @block_signals() {
%1 = alloca i32
%2 = call i32 @sigfillset(i32* %1)
%3 = load i32, i32* @SIG_BLOCK
%4 = call i32 @sigprocmask(i32 %3, i32* %1, i32* null)
ret void
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define void @block_signals() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @sigfillset(i32* %1)
%4 = load i32, i32* @SIG_BLOCK
%5 = call i32 @sigprocmask(i32 %4, i32* %1, i32* null)
ret void
}
int draw_arc(long x_0, long y_0, long w, long h, int th1, int th2, int mode) {
  x_0 = x_0;
  y_0 = y_0;
  w = w;
  h = h;
  th1 = th1;
  th2 = th2;
  mode = mode;
  return (1);
}


x86 assembly (clang, -O0):
<draw_arc>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    0x10(%rbp),%eax
mov    %eax,0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @draw_arc(i64 %0, i64 %1, i64 %2, i64 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i64 %0, i64* %8
store i64 %1, i64* %9
store i64 %2, i64* %10
store i64 %3, i64* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i64, i64* %8
store i64 %15, i64* %8
%16 = load i64, i64* %9
store i64 %16, i64* %9
%17 = load i64, i64* %10
store i64 %17, i64* %10
%18 = load i64, i64* %11
store i64 %18, i64* %11
%19 = load i32, i32* %12
store i32 %19, i32* %12
%20 = load i32, i32* %13
store i32 %20, i32* %13
%21 = load i32, i32* %14
store i32 %21, i32* %14
ret i32 1
}

LLVM IR (-O2):
define i32 @draw_arc(i64 %0, i64 %1, i64 %2, i64 %3, i32 %4, i32 %5, i32 %6) {
ret i32 1
}
void ext_unit2unit() {}


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

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

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

LLVM IR (-O2):
define void @ext_unit2unit() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main() {
  int var1 = 1;
  int var2 = 2;
  foo(var1);
  return var2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <foo@plt>
mov    $0x2,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 1)
ret i32 2
}
void *job(int input) {
  printf("%10s(): starting number %d\n", __FUNCTION__, input);
  sleep(1);
  printf("%10s(): completed number %d\n", __FUNCTION__, input);
}


x86 assembly (clang, -O0):
<job>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
lea    0xecb(%rip),%rdi
lea    0xee0(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x0,%al
call   1040 <sleep@plt>
mov    -0xc(%rbp),%edx
lea    0xec7(%rip),%rdi
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<job>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed3(%rip),%rdi
lea    0xee8(%rip),%r14
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
xor    %eax,%eax
call   1040 <sleep@plt>
lea    0xecd(%rip),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [28 x i8] c"%10s(): starting number %d\0A\00"
@__FUNCTION__.job = [4 x i8] c"job\00"
@.str.1 = [29 x i8] c"%10s(): completed number %d\0A\00"
define i8* @job(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.job, i64 0, i64 0), i32 %4)
%6 = call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%7 = load i32, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.job, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %2
ret i8* %9
}

LLVM IR (-O2):
@.str = [28 x i8] c"%10s(): starting number %d\0A\00"
@__FUNCTION__.job = [4 x i8] c"job\00"
@.str.1 = [29 x i8] c"%10s(): completed number %d\0A\00"
define i8* @job(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.job, i64 0, i64 0), i32 %0)
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @sleep to i32 (i32, ...)*)(i32 1)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @__FUNCTION__.job, i64 0, i64 0), i32 %0)
ret i8* undef
}
fatal(mes) {
  puts(mes);
  exit(2);
}


x86 assembly (clang, -O0):
<fatal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x0,%al
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fatal>:
push   %rax
xor    %eax,%eax
call   1030 <puts@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define i32 @fatal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @puts to i32 (i32, ...)*)(i32 %3)
unreachable
}

LLVM IR (-O2):
define i32 @fatal(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @puts to i32 (i32, ...)*)(i32 %0)
tail call void @exit(i32 2)
unreachable
}
/* Variables and functions */
int retZero();
int triggerDivZero() {
  int y = retZero();
  return 5 / y;
}


x86 assembly (clang, -O0):
<triggerDivZero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <retZero@plt>
mov    %eax,-0x4(%rbp)
mov    $0x5,%eax
cltd
idivl  -0x4(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triggerDivZero>:
push   %rax
xor    %eax,%eax
call   1030 <retZero@plt>
mov    %eax,%ecx
mov    $0x5,%eax
xor    %edx,%edx
idiv   %ecx
pop    %rcx
ret

LLVM IR (-O0):
define i32 @triggerDivZero() {
%1 = alloca i32
%2 = call i32 (...) @retZero()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sdiv i32 5, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @triggerDivZero() {
%1 = tail call i32 (...) @retZero()
%2 = sdiv i32 5, %1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ strncat(char *, char *, int);
int agrega_el_mil(char *buffer) {
  int len = 3;
  strncat(buffer, "mil", len);
  return len;
}


x86 assembly (clang, -O0):
<agrega_el_mil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xecf(%rip),%rsi
call   1030 <strncat@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<agrega_el_mil>:
push   %rax
lea    0xee8(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncat@plt>
mov    $0x3,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"mil\00"
define i32 @agrega_el_mil(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 3, i32* %3
%4 = load i8*, i8** %2
%5 = load i32, i32* %3
%6 = call i32 @strncat(i8* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %3
ret i32 %7
}

LLVM IR (-O2):
@.str = [4 x i8] c"mil\00"
define i32 @agrega_el_mil(i8* %0) {
%2 = tail call i32 @strncat(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
ret i32 3
}
void pp_test_loop() {}


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

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

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

LLVM IR (-O2):
define void @pp_test_loop() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
void pinyin_set_locale(char *locale) { setlocale(LC_ALL, locale); }


x86 assembly (clang, -O0):
<pinyin_set_locale>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
call   1030 <setlocale@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pinyin_set_locale>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <setlocale@plt>

LLVM IR (-O0):
@LC_ALL = global i32 0
define void @pinyin_set_locale(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @LC_ALL
%4 = load i8*, i8** %2
%5 = call i32 @setlocale(i32 %3, i8* %4)
ret void
}

LLVM IR (-O2):
@LC_ALL = global i32 0
define void @pinyin_set_locale(i8* %0) {
%2 = load i32, i32* @LC_ALL
%3 = tail call i32 @setlocale(i32 %2, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ clear_memory();
int /*<<< orphan*/ exit(int);
void interupt_signal() {
  clear_memory();
  exit(1);
}


x86 assembly (clang, -O0):
<interupt_signal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <clear_memory@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<interupt_signal>:
push   %rax
xor    %eax,%eax
call   1030 <clear_memory@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
define void @interupt_signal() {
%1 = call i32 (...) @clear_memory()
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @interupt_signal() {
%1 = tail call i32 (...) @clear_memory()
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
char *strrchr(char *, char);
void _stripexe(char *filename) {
  char *ptr;
  ptr = strrchr(filename, '.');
  if (ptr && !strcasecmp(ptr, ".exe"))
    *ptr = '\0';
}


x86 assembly (clang, -O0):
<_stripexe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2e,%esi
call   1040 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1169 <_stripexe+0x49>
mov    -0x10(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1169 <_stripexe+0x49>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_stripexe>:
push   %rbx
mov    $0x2e,%esi
call   1040 <strrchr@plt>
test   %rax,%rax
je     1146 <_stripexe+0x26>
mov    %rax,%rbx
lea    0xec6(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1148 <_stripexe+0x28>
pop    %rbx
ret
movb   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c".exe\00"
define void @_stripexe(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 46)
%3 = icmp eq i8* %2, null
br i1 %3, label %8, label %4
4: ; preds = %1
%5 = tail call i32 @strcasecmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %4
store i8 0, i8* %2
br label %8
8: ; preds = %7, %4, %1
ret void
}
int test_imm_29uint32_reg(unsigned int val) {
  return ((val) & (0x29 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_29uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x29,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_29uint32_reg(i32 %0) {
%2 = and i32 %0, 41
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
bool is_alpha(char c) {
  bool result = (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')));
  return result;
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jl     1129 <is_alpha+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x7a,%ecx
mov    %al,-0x9(%rbp)
jle    114e <is_alpha+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0xa(%rbp)
jl     1148 <is_alpha+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alpha(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %21, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 65
br i1 %14, label %15, label %19
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 90
br label %19
19: ; preds = %15, %11
%20 = phi i1 [ false, %11 ], [ %18, %15 ]
br label %21
21: ; preds = %19, %7
%22 = phi i1 [ true, %7 ], [ %20, %19 ]
%23 = zext i1 %22 to i32
store i32 %23, i32* %3
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
define i32 @is_alpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
int maxNumber(int a, int b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<maxNumber>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1121 <maxNumber+0x21>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1127 <maxNumber+0x27>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<maxNumber>:
mov    %esi,%eax
cmp    %esi,%edi
cmovg  %edi,%eax
ret

LLVM IR (-O0):
define i32 @maxNumber(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp sgt i32 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* %3
br label %12
10: ; preds = %2
%11 = load i32, i32* %4
br label %12
12: ; preds = %10, %8
%13 = phi i32 [ %9, %8 ], [ %11, %10 ]
ret i32 %13
}

LLVM IR (-O2):
define i32 @maxNumber(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = select i1 %3, i32 %0, i32 %1
ret i32 %4
}
int quad(int a, int b, int c) { return -3; }


x86 assembly (clang, -O0):
<quad>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xfffffffd,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @quad(i32 %0, i32 %1, i32 %2) {
ret i32 -3
}
/* Variables and functions */
int /*<<< orphan*/ clang_analyzer_eval(int);
int strlen(char *);
void strlen_constant0() { clang_analyzer_eval(strlen("123") == 3); }


x86 assembly (clang, -O0):
<strlen_constant0>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <strlen@plt>
cmp    $0x3,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <clang_analyzer_eval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen_constant0>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <strlen@plt>
xor    %edi,%edi
cmp    $0x3,%eax
sete   %dil
pop    %rax
jmp    1040 <clang_analyzer_eval@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"123\00"
define void @strlen_constant0() {
%1 = call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = call i32 @clang_analyzer_eval(i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"123\00"
define void @strlen_constant0() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @clang_analyzer_eval(i32 %3)
ret void
}
/* Variables and functions */
char *energymon_strencpy(char *, char *, size_t);
char *wattsup_get_implementation(char *buf, size_t buflen) {
  return energymon_strencpy(buf, "WattsUp? Power Meter", buflen);
}


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

x86 assembly (clang, -O2):
<wattsup_get_implementation>:
mov    %rsi,%rdx
lea    0xee6(%rip),%rsi
jmp    1030 <energymon_strencpy@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"WattsUp? Power Meter\00"
define i8* @wattsup_get_implementation(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @energymon_strencpy(i8* %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %6)
ret i8* %7
}

LLVM IR (-O2):
@.str = [21 x i8] c"WattsUp? Power Meter\00"
define i8* @wattsup_get_implementation(i8* %0, i64 %1) {
%3 = tail call i8* @energymon_strencpy(i8* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i64 %1)
ret i8* %3
}
int sysfs_create_bin_file(struct kobject *k, struct bin_attribute *a) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.kobject = type opaque
%struct.bin_attribute = type opaque
define i32 @sysfs_create_bin_file(%struct.kobject* nocapture readnone %0, %struct.bin_attribute* nocapture readnone %1) {
ret i32 0
}
/* Variables and functions */
void *do_malloc_pages(size_t, size_t, int /*<<< orphan*/);
void *malloc_pages(size_t len, size_t alignment) {
  return do_malloc_pages(len, alignment, 0);
}


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

x86 assembly (clang, -O2):
<malloc_pages>:
xor    %edx,%edx
jmp    1030 <do_malloc_pages@plt>

LLVM IR (-O0):
define i8* @malloc_pages(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 = load i64, i64* %4
%7 = call i8* @do_malloc_pages(i64 %5, i64 %6, i32 0)
ret i8* %7
}

LLVM IR (-O2):
define i8* @malloc_pages(i64 %0, i64 %1) {
%3 = tail call i8* @do_malloc_pages(i64 %0, i64 %1, i32 0)
ret i8* %3
}
int test_imm_82int16_mem(short *val) {
  return ((*val) & (0x82 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_82int16_mem>:
testb  $0x82,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_82int16_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, 130
%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_82int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 130
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ asprintf(char **, char *, int);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ report_status(char *);
void report_int(int value) {
  char *string;
  asprintf(&string, "%d", value);
  report_status(string);
  free(string);
}


x86 assembly (clang, -O0):
<report_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    -0x10(%rbp),%rdi
lea    0xeb7(%rip),%rsi
call   1050 <asprintf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <report_status@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_int>:
push   %rax
mov    %edi,%edx
lea    0xec6(%rip),%rsi
mov    %rsp,%rdi
call   1050 <asprintf@plt>
mov    (%rsp),%rdi
call   1040 <report_status@plt>
mov    (%rsp),%rdi
call   1030 <free@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @report_int(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @asprintf(i8** %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i8*, i8** %3
%7 = call i32 @report_status(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @report_int(i32 %0) {
%2 = alloca i8*
%3 = bitcast i8** %2 to i8*
%4 = call i32 @asprintf(i8** %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = load i8*, i8** %2
%6 = call i32 @report_status(i8* %5)
%7 = load i8*, i8** %2
%8 = call i32 @free(i8* %7)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_seperator() { printf("+---+----------------+----------------+\n"); }


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

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

LLVM IR (-O0):
@.str = [41 x i8] c"+---+----------------+----------------+\0A\00"
define void @print_seperator() {
%1 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"+---+----------------+----------------+\00"
define void @print_seperator() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ pow(double, float);
float fe_melinv(float x) {
  return (float)(700.0 * ((float)pow(10.0, x / 2595.0) - 1.0));
}


x86 assembly (clang, -O0):
<fe_melinv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
call   1030 <pow@plt>
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
subsd  %xmm0,%xmm1
movsd  0xea0(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fe_melinv>:
push   %rax
movaps %xmm0,%xmm1
divss  0xee4(%rip),%xmm1
movsd  0xee4(%rip),%xmm0
call   1030 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0xed3(%rip),%xmm0
mulsd  0xed3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @fe_melinv(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fdiv double %4, 2.595000e+03
%6 = fptrunc double %5 to float
%7 = call i64 @pow(double 1.000000e+01, float %6)
%8 = sitofp i64 %7 to float
%9 = fpext float %8 to double
%10 = fsub double %9, 1.000000e+00
%11 = fmul double 7.000000e+02, %10
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
define float @fe_melinv(float %0) {
%2 = fdiv float %0, 2.595000e+03
%3 = tail call i64 @pow(double 1.000000e+01, float %2)
%4 = sitofp i64 %3 to float
%5 = fpext float %4 to double
%6 = fadd double %5, -1.000000e+00
%7 = fmul double %6, 7.000000e+02
%8 = fptrunc double %7 to float
ret float %8
}
/* Variables and functions */
double fun(int, int);
int /*<<< orphan*/ fun1();
double fun2(int, int);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, double, double);
int main() {
  fun1();
  printf("%f\n%f\n", fun(10, 200) - 100, fun2(10, 100));
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <fun1@plt>
mov    $0xa,%edi
mov    $0xc8,%esi
call   1040 <fun@plt>
movsd  0xe83(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    $0xa,%edi
mov    $0x64,%esi
call   1030 <fun2@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
lea    0xe64(%rip),%rdi
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <fun1@plt>
mov    $0xa,%edi
mov    $0xc8,%esi
call   1040 <fun@plt>
addsd  0xe91(%rip),%xmm0
movsd  %xmm0,(%rsp)
mov    $0xa,%edi
mov    $0x64,%esi
call   1030 <fun2@plt>
movapd %xmm0,%xmm1
lea    0xe7a(%rip),%rdi
movsd  (%rsp),%xmm0
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%f\0A%f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @fun1()
%3 = call double @fun(i32 10, i32 200)
%4 = fsub double %3, 1.000000e+02
%5 = call double @fun2(i32 10, i32 100)
%6 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %4, double %5)
%7 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%f\0A%f\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @fun1()
%2 = tail call double @fun(i32 10, i32 200)
%3 = fadd double %2, -1.000000e+02
%4 = tail call double @fun2(i32 10, i32 100)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %3, double %4)
%6 = tail call i32 (...) @getchar()
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ override_redirect;
};
struct TYPE_4__ {
  TYPE_1__ xconfigure;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xconfigure_override_redirect(void *_p) {
  return (int)((XEvent *)_p)->xconfigure.override_redirect;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XEvent_xconfigure_override_redirect(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
pexit(s1, s2) char *s1, *s2;
{
  printf("Build: %s%s\n", s1, s2);
  exit(1);
}


x86 assembly (clang, -O0):
<pexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<pexit>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"Build: %s%s\0A\00"
define i32 @pexit(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
unreachable
}

LLVM IR (-O2):
@.str = [13 x i8] c"Build: %s%s\0A\00"
define i32 @pexit(i8* %0, i8* %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
tail call void @exit(i32 1)
unreachable
}
/* Variables and functions */
float back_in(float, float, float);
float back_f_in(float step, float max_steps, float max_val) {
  return back_in(step, max_steps, max_val);
}


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

x86 assembly (clang, -O2):
<back_f_in>:
jmp    1030 <back_in@plt>

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

LLVM IR (-O2):
define float @back_f_in(float %0, float %1, float %2) {
%4 = tail call float @back_in(float %0, float %1, float %2)
ret float %4
}
/* Variables and functions */
int /*<<< orphan*/ abort();
char *m(char *x) { abort(); }


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

x86 assembly (clang, -O2):
<m>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i8* @m(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define noalias i8* @m(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @abort()
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ add();
int /*<<< orphan*/ by_at(int /*<<< orphan*/);
void add_by_at(uint32_t x) {
  by_at(x);
  add();
}


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

x86 assembly (clang, -O2):
<add_by_at>:
push   %rax
call   1040 <by_at@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <add@plt>

LLVM IR (-O0):
define void @add_by_at(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @by_at(i32 %3)
%5 = call i32 (...) @add()
ret void
}

LLVM IR (-O2):
define void @add_by_at(i32 %0) {
%2 = tail call i32 @by_at(i32 %0)
%3 = tail call i32 (...) @add()
ret void
}