xunge/DecIR huggingface dataset:
int test_imm_9Fuint8_mem(unsigned char *val) {
  return ((*val) & (-0x9F << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Fuint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -159
%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_9Fuint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 97
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
char *strdup(char *);
char *C_mkFixedEndC() {
  char *text = strdup("#endif //PERVASIVES_C\n");
  return text;
}


x86 assembly (clang, -O0):
<C_mkFixedEndC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [23 x i8] c"#endif //PERVASIVES_C\0A\00"
define i8* @C_mkFixedEndC() {
%1 = alloca i8*
%2 = call i8* @strdup(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
@.str = [23 x i8] c"#endif //PERVASIVES_C\0A\00"
define noalias i8* @C_mkFixedEndC() {
%1 = tail call dereferenceable_or_null(23) i8* @strdup(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ remove(char *);
int /*<<< orphan*/ rename(char *, char *);
int main() {
  rename("abc.txt", "def.txt");
  remove("def.txt");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1040 <rename@plt>
lea    0xebf(%rip),%rdi
call   1030 <remove@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rdi
lea    0xed9(%rip),%rbx
mov    %rbx,%rsi
call   1040 <rename@plt>
mov    %rbx,%rdi
call   1030 <remove@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"abc.txt\00"
@.str.1 = [8 x i8] c"def.txt\00"
define i32 @main() {
%1 = tail call i32 @rename(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @remove(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int sum(int);
int main() {
  int number, result;
  printf("Enter a positive integer: ");
  scanf("%d", &number);
  result = sum(number);
  printf("sum=%d", result);
}


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

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

LLVM IR (-O0):
@.str = [27 x i8] c"Enter a positive integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"sum=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @sum(i32 %5)
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Enter a positive integer: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"sum=%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 @sum(i32 %5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ msroute_read_journey();
void msroute_read(void) { msroute_read_journey(); }


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

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

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

LLVM IR (-O2):
define void @msroute_read() {
%1 = tail call i32 (...) @msroute_read_journey()
ret void
}
__typeof__(strlen(1)) test_strlen_192(void) { return strlen(1); }


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

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

LLVM IR (-O0):
define i64 @test_strlen_192() {
%1 = call i64 @strlen(i8* inttoptr (i64 1 to i8*))
ret i64 %1
}

LLVM IR (-O2):
define i64 @test_strlen_192() {
%1 = tail call i64 @strlen(i8* inttoptr (i64 1 to i8*))
ret i64 %1
}
void foo(int b) {
  extern void bar(void);
  extern void baz(void);
  void *p;
  if (b)
    p = bar;
  else
    p = baz;
  *(char *)p = 1;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1121 <foo+0x21>
mov    0x2ec8(%rip),%rax
mov    %rax,-0x10(%rbp)
jmp    112c <foo+0x2c>
mov    0x2eb0(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x1,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %edi,%edi
jne    110f <foo+0xf>
mov    0x2ecd(%rip),%rax
movb   $0x1,(%rax)
ret
mov    0x2eca(%rip),%rax
movb   $0x1,(%rax)
ret

LLVM IR (-O0):
define void @foo(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i8* bitcast (void ()* @bar to i8*), i8** %3
br label %8
7: ; preds = %1
store i8* bitcast (void ()* @baz to i8*), i8** %3
br label %8
8: ; preds = %7, %6
%9 = load i8*, i8** %3
store i8 1, i8* %9
ret void
}

LLVM IR (-O2):
define void @foo(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* bitcast (void ()* @baz to i8*), i8* bitcast (void ()* @bar to i8*)
store i8 1, i8* %3
ret void
}
void strip_comments(char *line) {
  int i;
  for (i = 0; line[i] != 0; i++) {
    if (line[i] == '#' || line[i] == ';') {
      line[i] = 0;
      break;
    }
  }
}


x86 assembly (clang, -O0):
<strip_comments>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1172 <strip_comments+0x72>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x23,%eax
je     114e <strip_comments+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3b,%eax
jne    115f <strip_comments+0x5f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1172 <strip_comments+0x72>
jmp    1164 <strip_comments+0x64>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <strip_comments+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_comments>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     112e <strip_comments+0x2e>
cmp    $0x3b,%cl
je     1128 <strip_comments+0x28>
cmp    $0x23,%cl
je     1128 <strip_comments+0x28>
add    $0x1,%rax
jmp    1110 <strip_comments+0x10>
mov    %eax,%eax
movb   $0x0,(%rdi,%rax,1)
ret

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

LLVM IR (-O2):
define void @strip_comments(i8* nocapture %0) {
br label %2
2: ; preds = %9, %1
%3 = phi i64 [ %10, %9 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
switch i8 %5, label %9 [
i8 0, label %11
i8 35, label %6
i8 59, label %6
]
6: ; preds = %2, %2
%7 = and i64 %3, 4294967295
%8 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 0, i8* %8
br label %11
9: ; preds = %2
%10 = add nuw i64 %3, 1
br label %2
11: ; preds = %2, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fnasso_printf(int, char const *, char *, int);
void fnasso_func_end(int level, const char *fooname, int status) {
  fnasso_printf(level, fooname, "exit status (%d)", status);
}


x86 assembly (clang, -O0):
<fnasso_func_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%ecx
lea    0xecd(%rip),%rdx
call   1030 <fnasso_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fnasso_func_end>:
mov    %edx,%ecx
lea    0xee7(%rip),%rdx
jmp    1030 <fnasso_printf@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"exit status (%d)\00"
define void @fnasso_func_end(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i32, i32* %6
%10 = call i32 @fnasso_printf(i32 %7, i8* %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"exit status (%d)\00"
define void @fnasso_func_end(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @fnasso_printf(i32 %0, i8* %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
unsigned long f4(unsigned int x) { return __builtin_clz(x) & 1023ULL; }


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
bsr    %eax,%eax
xor    $0x1f,%eax
cltq
and    $0x3ff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
bsr    %edi,%eax
xor    $0x1f,%eax
ret

LLVM IR (-O0):
define i64 @f4(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @llvm.ctlz.i32(i32 %3, i1 true)
%5 = sext i32 %4 to i64
%6 = and i64 %5, 1023
ret i64 %6
}

LLVM IR (-O2):
define i64 @f4(i32 %0) {
%2 = tail call i32 @llvm.ctlz.i32(i32 %0, i1 true)
%3 = zext i32 %2 to i64
ret i64 %3
}
/* Variables and functions */
int f(int, int, int);
int main() { return f(1, 2, 3); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2, i32 3)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ clock0();
int /*<<< orphan*/ delay();
int /*<<< orphan*/ waitBusy();
void clockBegin(void) {
  waitBusy();
  clock0();
  delay();
}


x86 assembly (clang, -O0):
<clockBegin>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <waitBusy@plt>
mov    $0x0,%al
call   1040 <clock0@plt>
mov    $0x0,%al
call   1050 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<clockBegin>:
push   %rax
xor    %eax,%eax
call   1030 <waitBusy@plt>
xor    %eax,%eax
call   1040 <clock0@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <delay@plt>

LLVM IR (-O0):
define void @clockBegin() {
%1 = call i32 (...) @waitBusy()
%2 = call i32 (...) @clock0()
%3 = call i32 (...) @delay()
ret void
}

LLVM IR (-O2):
define void @clockBegin() {
%1 = tail call i32 (...) @waitBusy()
%2 = tail call i32 (...) @clock0()
%3 = tail call i32 (...) @delay()
ret void
}
void soru_4(int *kucuk, int *buyuk) {}


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

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

LLVM IR (-O0):
define void @soru_4(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
ret void
}

LLVM IR (-O2):
define void @soru_4(i32* nocapture %0, i32* nocapture %1) {
ret void
}
mvcur(a, b) int a, b;
{ printf("[%d;%dH", a + 1, b + 1); }


x86 assembly (clang, -O0):
<mvcur>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
add    $0x1,%edx
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mvcur>:
lea    0x1(%rdi),%eax
lea    0x1(%rsi),%edx
lea    0xee3(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define i32 @mvcur(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 1
%8 = load i32, i32* %5
%9 = add nsw i32 %8, 1
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 %9)
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dH\00"
define i32 @mvcur(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 1
%4 = add nsw i32 %1, 1
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 undef
}
void def_disabled_init() {}


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

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

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

LLVM IR (-O2):
define void @def_disabled_init() {
ret void
}
int flash_ulpmc(void *data, unsigned sz) { return stub_operation(__func__); }


x86 assembly (clang, -O0):
<flash_ulpmc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <stub_operation@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<flash_ulpmc>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <stub_operation@plt>

LLVM IR (-O0):
@__func__.flash_ulpmc = [12 x i8] c"flash_ulpmc\00"
define i32 @flash_ulpmc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @stub_operation to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.flash_ulpmc, i64 0, i64 0))
ret i32 %5
}

LLVM IR (-O2):
@__func__.flash_ulpmc = [12 x i8] c"flash_ulpmc\00"
define i32 @flash_ulpmc(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @stub_operation to i32 (i8*, ...)*)(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @__func__.flash_ulpmc, i64 0, i64 0))
ret i32 %3
}
int moltiplica(int x) { return x * x; }


x86 assembly (clang, -O0):
<moltiplica>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @moltiplica(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @moltiplica(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0x15() {
  Assert_real((isodigit(21) == 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_isodigit.c",
              110, ("isodigit should be 0 for 0x15"));
}


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

x86 assembly (clang, -O2):
<t_isodigit_0x15>:
push   %rax
mov    $0x15,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x6e,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x15\00"
define void @t_isodigit_0x15() {
%1 = call i64 @isodigit(i32 21)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 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_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0x15\00"
define void @t_isodigit_0x15() {
%1 = tail call i64 @isodigit(i32 21)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 110, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
int checkwhite(char c) {
  if (c == '\n' || c == ' ' || c == '\t' || c == '\r' || c == '\b')
    return (1);
  return (0);
}


x86 assembly (clang, -O0):
<checkwhite>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
je     114b <checkwhite+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
je     114b <checkwhite+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x9,%eax
je     114b <checkwhite+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0xd,%eax
je     114b <checkwhite+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x8,%eax
jne    1157 <checkwhite+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <checkwhite+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkwhite>:
cmp    $0x20,%dil
ja     1120 <checkwhite+0x20>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x100002700,%rdx
bt     %rcx,%rdx
jae    1120 <checkwhite+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @checkwhite(i8 signext %0) {
switch i8 %0, label %2 [
i8 32, label %3
i8 13, label %3
i8 10, label %3
i8 9, label %3
i8 8, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ test_parser_sourcefile(char *, char *);
int /*<<< orphan*/ test_parser_verify_parse(int /*<<< orphan*/, char *, char *,
                                            char *, int /*<<< orphan*/);
void test_shell_comments() {
  test_parser_verify_parse(test_parser_sourcefile("shell", " #comment"),
                           "shell", "", "#comment", 0);
}


x86 assembly (clang, -O0):
<test_shell_comments>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xed4(%rip),%rsi
call   1030 <test_parser_sourcefile@plt>
mov    %eax,%edi
lea    0xec0(%rip),%rsi
lea    0xebe(%rip),%rdx
lea    0xeb9(%rip),%rcx
xor    %r8d,%r8d
call   1040 <test_parser_verify_parse@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_shell_comments>:
push   %rbx
lea    0xed8(%rip),%rbx
lea    0xed7(%rip),%rsi
mov    %rbx,%rdi
call   1030 <test_parser_sourcefile@plt>
lea    0xec7(%rip),%rdx
lea    0xec2(%rip),%rcx
mov    %eax,%edi
mov    %rbx,%rsi
xor    %r8d,%r8d
pop    %rbx
jmp    1040 <test_parser_verify_parse@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"shell\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_shell_comments() {
%1 = call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"shell\00"
@.str.1 = [10 x i8] c" #comment\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [9 x i8] c"#comment\00"
define void @test_shell_comments() {
%1 = tail call i32 @test_parser_sourcefile(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @test_parser_verify_parse(i32 %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 0)
ret void
}
/* Variables and functions */
float __infer_nondet_float();
float ldexpf(float x, int exp) { return __infer_nondet_float(); }


x86 assembly (clang, -O0):
<ldexpf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define float @ldexpf(float %0, i32 %1) {
%3 = alloca float
%4 = alloca i32
store float %0, float* %3
store i32 %1, i32* %4
%5 = call float (...) @__infer_nondet_float()
ret float %5
}

LLVM IR (-O2):
define float @ldexpf(float %0, i32 %1) {
%3 = tail call float (...) @__infer_nondet_float()
ret float %3
}
/* Variables and functions */
int /*<<< orphan*/ CS(int);
int /*<<< orphan*/ DC(int);
int /*<<< orphan*/ LCD_out(unsigned char);
void write_d(unsigned char out_data) {
  DC(1);
  CS(0);
  LCD_out(out_data);
  CS(1);
  DC(1);
}


x86 assembly (clang, -O0):
<write_d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
call   1030 <DC@plt>
xor    %edi,%edi
call   1050 <CS@plt>
movzbl -0x1(%rbp),%edi
call   1040 <LCD_out@plt>
mov    $0x1,%edi
call   1050 <CS@plt>
mov    $0x1,%edi
call   1030 <DC@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_d>:
push   %rbx
mov    %edi,%ebx
mov    $0x1,%edi
call   1030 <DC@plt>
xor    %edi,%edi
call   1050 <CS@plt>
mov    %ebx,%edi
call   1040 <LCD_out@plt>
mov    $0x1,%edi
call   1050 <CS@plt>
mov    $0x1,%edi
pop    %rbx
jmp    1030 <DC@plt>

LLVM IR (-O0):
define void @write_d(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = call i32 @DC(i32 1)
%4 = call i32 @CS(i32 0)
%5 = load i8, i8* %2
%6 = call i32 @LCD_out(i8 zeroext %5)
%7 = call i32 @CS(i32 1)
%8 = call i32 @DC(i32 1)
ret void
}

LLVM IR (-O2):
define void @write_d(i8 zeroext %0) {
%2 = tail call i32 @DC(i32 1)
%3 = tail call i32 @CS(i32 0)
%4 = tail call i32 @LCD_out(i8 zeroext %0)
%5 = tail call i32 @CS(i32 1)
%6 = tail call i32 @DC(i32 1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
void imprime_string_sem_n(char string[]) {
  int i;
  for (i = 0; string[i] != '\n'; i++)
    printf("%c", string[i]);
}


x86 assembly (clang, -O0):
<imprime_string_sem_n>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
je     115e <imprime_string_sem_n+0x4e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
lea    0xeb9(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <imprime_string_sem_n+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<imprime_string_sem_n>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%al
cmp    $0xa,%al
je     1146 <imprime_string_sem_n+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
lea    0xed8(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
cmp    $0xa,%al
jne    1130 <imprime_string_sem_n+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @imprime_string_sem_n(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 10
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %10, %4 ], [ %2, %1 ]
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %6)
%8 = add nuw i64 %5, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %8
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 10
br i1 %11, label %12, label %4
12: ; preds = %4, %1
ret void
}
int is_happy_cal(int n) {
  int sum, tmp;
  sum = 0;
  while (n) {
    tmp = n % 10;
    sum += tmp * tmp;
    n /= 10;
  }
  return sum;
}


x86 assembly (clang, -O0):
<is_happy_cal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1146 <is_happy_cal+0x46>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
jmp    110e <is_happy_cal+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_happy_cal>:
xor    %eax,%eax
test   %edi,%edi
je     113e <is_happy_cal+0x3e>
cs nopw 0x0(%rax,%rax,1)
movslq %edi,%rcx
imul   $0x66666667,%rcx,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %ecx,%esi
sub    %edx,%esi
imul   %esi,%esi
add    %esi,%eax
add    $0x9,%ecx
cmp    $0x12,%ecx
ja     1110 <is_happy_cal+0x10>
ret

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

LLVM IR (-O2):
define i32 @is_happy_cal(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %12, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %9, %3 ], [ %0, %1 ]
%5 = phi i32 [ %8, %3 ], [ 0, %1 ]
%6 = srem i32 %4, 10
%7 = mul nsw i32 %6, %6
%8 = add nuw nsw i32 %7, %5
%9 = sdiv i32 %4, 10
%10 = add i32 %4, 9
%11 = icmp ult i32 %10, 19
br i1 %11, label %12, label %3
12: ; preds = %3, %1
%13 = phi i32 [ 0, %1 ], [ %8, %3 ]
ret i32 %13
}
long double foo(long double x, long double y) { return x + y; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
faddp  %st,%st(1)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
faddp  %st,%st(1)
ret

LLVM IR (-O0):
define x86_fp80 @foo(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %3
store x86_fp80 %1, x86_fp80* %4
%5 = load x86_fp80, x86_fp80* %3
%6 = load x86_fp80, x86_fp80* %4
%7 = fadd x86_fp80 %5, %6
ret x86_fp80 %7
}

LLVM IR (-O2):
define x86_fp80 @foo(x86_fp80 %0, x86_fp80 %1) {
%3 = fadd x86_fp80 %0, %1
ret x86_fp80 %3
}
int compare(int x, int y) { return (x > y) ? 1 : 0; }


x86 assembly (clang, -O0):
<compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare>:
xor    %eax,%eax
cmp    %esi,%edi
setg   %al
ret

LLVM IR (-O0):
define i32 @compare(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
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 1, i32 0
ret i32 %9
}

LLVM IR (-O2):
define i32 @compare(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void sesc_change_epoch(void) {
  fprintf(stderr, "TLS simulator needed for sesc_change_epoch\n");
  exit(-1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"TLS simulator needed for sesc_change_epoch\0A\00"
define void @sesc_change_epoch() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 -1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [44 x i8] c"TLS simulator needed for sesc_change_epoch\0A\00"
define void @sesc_change_epoch() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 -1)
unreachable
}
const char *db_create_entities_table_sql(void) {
  static const char *query =
      "CREATE TABLE entities ("
      "    id         INTEGER         NOT NULL AUTO_INCREMENT,"
      "    name       VARCHAR(100)    NOT NULL,"
      "    currency   CHAR(30)        NOT NULL DEFAULT 'USD',"
      "    parent     INT             NOT NULL,"
      "    aggregate  BOOLEAN         NOT NULL DEFAULT FALSE,"
      "  CONSTRAINT entities_pk"
      "    PRIMARY KEY (id),"
      "  CONSTRAINT entities_parent_fk"
      "    FOREIGN KEY (parent)"
      "    REFERENCES entities(id)"
      ");";
  return query;
}


x86 assembly (clang, -O0):
<db_create_entities_table_sql>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f15(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_create_entities_table_sql>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@db_create_entities_table_sql.query = internal global i8* getelementptr inbounds ([396 x i8], [396 x i8]* @.str, i32 0, i32 0)
@.str = [396 x i8] c"CREATE TABLE entities ( id INTEGER NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL, currency CHAR(30) NOT NULL DEFAULT 'USD', parent INT NOT NULL, aggregate BOOLEAN NOT NULL DEFAULT FALSE, CONSTRAINT entities_pk PRIMARY KEY (id), CONSTRAINT entities_parent_fk FOREIGN KEY (parent) REFERENCES entities(id));\00"
define i8* @db_create_entities_table_sql() {
%1 = load i8*, i8** @db_create_entities_table_sql.query
ret i8* %1
}

LLVM IR (-O2):
@.str = [396 x i8] c"CREATE TABLE entities ( id INTEGER NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL, currency CHAR(30) NOT NULL DEFAULT 'USD', parent INT NOT NULL, aggregate BOOLEAN NOT NULL DEFAULT FALSE, CONSTRAINT entities_pk PRIMARY KEY (id), CONSTRAINT entities_parent_fk FOREIGN KEY (parent) REFERENCES entities(id));\00"
define i8* @db_create_entities_table_sql() {
ret i8* getelementptr inbounds ([396 x i8], [396 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
scalar_t__ malloc(size_t);
int /*<<< orphan*/ nrerror(char *);
unsigned int *lvector(int nl, int nh) {
  unsigned int *v;
  v = (unsigned int *)malloc((size_t)((nh - nl + 1 + 1) * sizeof(int)));
  if (!v)
    nrerror("allocation failure in lvector()");
  return v - nl + 1;
}


x86 assembly (clang, -O0):
<lvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1161 <lvector+0x41>
lea    0xea4(%rip),%rdi
call   1030 <nrerror@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
add    $0x4,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lvector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
add    $0x2,%esi
movslq %esi,%rdi
shl    $0x2,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114a <lvector+0x2a>
lea    0xebb(%rip),%rdi
call   1030 <nrerror@plt>
movslq %ebp,%rax
shl    $0x2,%rax
sub    %rax,%rbx
add    $0x4,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i32* @lvector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = add nsw i32 %9, 1
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 4
%13 = call i64 @malloc(i64 %12)
%14 = inttoptr i64 %13 to i32*
store i32* %14, i32** %5
%15 = load i32*, i32** %5
%16 = icmp ne i32* %15, null
br i1 %16, label %19, label %17
17: ; preds = %2
%18 = call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %2
%20 = load i32*, i32** %5
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = sub i64 0, %22
%24 = getelementptr inbounds i32, i32* %20, i64 %23
%25 = getelementptr inbounds i32, i32* %24, i64 1
ret i32* %25
}

LLVM IR (-O2):
@.str = [32 x i8] c"allocation failure in lvector()\00"
define i32* @lvector(i32 %0, i32 %1) {
%3 = sub i32 2, %0
%4 = add i32 %3, %1
%5 = sext i32 %4 to i64
%6 = shl nsw i64 %5, 2
%7 = tail call i64 @malloc(i64 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @nrerror(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = inttoptr i64 %7 to i32*
%13 = sext i32 %0 to i64
%14 = sub nsw i64 0, %13
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = getelementptr inbounds i32, i32* %15, i64 1
ret i32* %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char);
int main() {
  char wrong[5];
  wrong[0] = 97;
  wrong[1] = 98;
  wrong[2] = 99;
  wrong[3] = 100;
  wrong[4] = 101;
  printf("%d", wrong[6]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x61,-0x9(%rbp)
movb   $0x62,-0x8(%rbp)
movb   $0x63,-0x7(%rbp)
movb   $0x64,-0x6(%rbp)
movb   $0x65,-0x5(%rbp)
lea    0xec6(%rip),%rdi
movsbl -0x3(%rbp),%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
store i8 97, i8* %3
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 1
store i8 98, i8* %4
%5 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 2
store i8 99, i8* %5
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 3
store i8 100, i8* %6
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 4
store i8 101, i8* %7
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 6
%9 = load i8, i8* %8
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext poison)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ __clear_bit_le(int, void *);
void *mb_correct_addr_and_bit(int *, void *);
__attribute__((always_)) __attribute__((no_instrument_function)) void
mb_clear_bit(int bit, void *addr) {
  addr = mb_correct_addr_and_bit(&bit, addr);
  __clear_bit_le(bit, addr);
}


x86 assembly (clang, -O0):
<mb_clear_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x4(%rbp),%rdi
call   1030 <mb_correct_addr_and_bit@plt>
mov    %rax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <__clear_bit_le@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mb_clear_bit>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <mb_correct_addr_and_bit@plt>
mov    0x4(%rsp),%edi
mov    %rax,%rsi
call   1040 <__clear_bit_le@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @mb_clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i8* @mb_correct_addr_and_bit(i32* %3, i8* %5)
store i8* %6, i8** %4
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = call i32 @__clear_bit_le(i32 %7, i8* %8)
ret void
}

LLVM IR (-O2):
define void @mb_clear_bit(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i8* @mb_correct_addr_and_bit(i32* %3, i8* %1)
%5 = load i32, i32* %3
%6 = call i32 @__clear_bit_le(i32 %5, i8* %4)
ret void
}
void __construct(void) {}


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

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

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

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


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

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

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

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

/* Variables and functions */
char const *_Locale_extract_name(char const *, int *);
char const *_Locale_extract_numeric_name(const char *name, char *buf,
                                         struct _Locale_name_hint *hint,
                                         int *__err_code) {
  return _Locale_extract_name(name, __err_code);
}


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

x86 assembly (clang, -O2):
<_Locale_extract_numeric_name>:
mov    %rcx,%rsi
jmp    1030 <_Locale_extract_name@plt>

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

LLVM IR (-O2):
%struct._Locale_name_hint = type { i32 }
define i8* @_Locale_extract_numeric_name(i8* %0, i8* nocapture readnone %1, %struct._Locale_name_hint* nocapture readnone %2, i32* %3) {
%5 = tail call i8* @_Locale_extract_name(i8* %0, i32* %3)
ret i8* %5
}
/* Variables and functions */
char *mystrdup(char *);
char *strchr(char *, char);
char *getport(char *host) {
  char *p, *q;
  q = strchr(host, ':');
  if (q)
    p = mystrdup(q + 1);
  else
    p = mystrdup("80");
  return p;
}


x86 assembly (clang, -O0):
<getport>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115f <getport+0x3f>
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1040 <mystrdup@plt>
mov    %rax,-0x10(%rbp)
jmp    116f <getport+0x4f>
lea    0xe9a(%rip),%rdi
call   1040 <mystrdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getport>:
push   %rax
mov    $0x3a,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     113d <getport+0x1d>
add    $0x1,%rax
mov    %rax,%rdi
pop    %rax
jmp    1040 <mystrdup@plt>
lea    0xebc(%rip),%rdi
pop    %rax
jmp    1040 <mystrdup@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"80\00"
define i8* @getport(i8* %0) {
%2 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 58)
%3 = icmp eq i8* %2, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %2, i64 1
%6 = tail call i8* @mystrdup(i8* %5)
br label %9
7: ; preds = %1
%8 = tail call i8* @mystrdup(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %4
%10 = phi i8* [ %6, %4 ], [ %8, %7 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void sigterm_handler(int sig) {
  ((void)sig);
  printf("Received SIGTERM...\n");
  exit(0);
}


x86 assembly (clang, -O0):
<sigterm_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
@.str = [21 x i8] c"Received SIGTERM...\0A\00"
define void @sigterm_handler(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [20 x i8] c"Received SIGTERM...\00"
define void @sigterm_handler(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}