xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, size_t);
char *sizeu1(size_t num) {
  static char sizeu1_buf[28];
  sprintf(sizeu1_buf,
          "%"
          "zu",
          num);
  return sizeu1_buf;
}


x86 assembly (clang, -O0):
<sizeu1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
lea    0x2f19(%rip),%rdi
lea    0xed2(%rip),%rsi
call   1030 <sprintf@plt>
lea    0x2f06(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sizeu1>:
push   %rbx
mov    %rdi,%rdx
lea    0x2f25(%rip),%rbx
lea    0xede(%rip),%rsi
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@sizeu1.sizeu1_buf = internal global [28 x i8] zeroinitializer
@.str = [4 x i8] c"%zu\00"
define i8* @sizeu1(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @sprintf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @sizeu1.sizeu1_buf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %3)
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @sizeu1.sizeu1_buf, i64 0, i64 0)
}

LLVM IR (-O2):
@sizeu1.sizeu1_buf = internal global [28 x i8] zeroinitializer
@.str = [4 x i8] c"%zu\00"
define i8* @sizeu1(i64 %0) {
%2 = tail call i32 @sprintf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @sizeu1.sizeu1_buf, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 %0)
ret i8* getelementptr inbounds ([28 x i8], [28 x i8]* @sizeu1.sizeu1_buf, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ setvbuf(int /*<<< orphan*/ *, char *, int, size_t);
void uninivar_setvbuf(void) {
  FILE *stream;
  char *buf;
  int mode;
  size_t size;
  (void)setvbuf(stream, buf, mode, size);
}


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

x86 assembly (clang, -O2):
<uninivar_setvbuf>:
jmp    1030 <setvbuf@plt>

LLVM IR (-O0):
define void @uninivar_setvbuf() {
%1 = alloca i32*
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
%5 = load i32*, i32** %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = load i64, i64* %4
%9 = call i32 @setvbuf(i32* %5, i8* %6, i32 %7, i64 %8)
ret void
}

LLVM IR (-O2):
define void @uninivar_setvbuf() {
%1 = tail call i32 @setvbuf(i32* undef, i8* undef, i32 undef, i64 undef)
ret void
}
/* Type definitions */
struct Var {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pA(char *, char const *, char const *, char const *);
void __func_add_double(struct Var *avar, const char *areg, const char *lreg,
                       const char *rreg) {
  pA("%s = %s + %s;", areg, lreg, rreg);
}


x86 assembly (clang, -O0):
<__func_add_double>:
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    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xec5(%rip),%rdi
call   1030 <pA@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s + %s;\00"
define void @__func_add_double(%struct.Var* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca %struct.Var*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store %struct.Var* %0, %struct.Var** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i8*, i8** %6
%10 = load i8*, i8** %7
%11 = load i8*, i8** %8
%12 = call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.Var = type { i32 }
@.str = [14 x i8] c"%s = %s + %s;\00"
define void @__func_add_double(%struct.Var* nocapture readnone %0, i8* %1, i8* %2, i8* %3) {
%5 = tail call i32 @pA(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
ret void
}
void s5pv310_default_sdhci2(void) {}


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

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

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

LLVM IR (-O2):
define void @s5pv310_default_sdhci2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ blinknumber(int, int);
int /*<<< orphan*/ blinkstring(char *);
int /*<<< orphan*/ makecommands();
int /*<<< orphan*/ setgpiopin(int);
int main() {
  setgpiopin(1);
  makecommands();
  int number1 = 456;
  blinknumber(number1, 3);
  char str[25] = "ABCabc";
  blinkstring(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1030 <setgpiopin@plt>
mov    $0x0,%al
call   1060 <makecommands@plt>
movl   $0x1c8,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x3,%esi
call   1050 <blinknumber@plt>
mov    0xe85(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe82(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe7f(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe7d(%rip),%al
mov    %al,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
call   1040 <blinkstring@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    $0x1,%edi
call   1030 <setgpiopin@plt>
xor    %eax,%eax
call   1060 <makecommands@plt>
mov    $0x1c8,%edi
mov    $0x3,%esi
call   1050 <blinknumber@plt>
movups 0xe9e(%rip),%xmm0
movups %xmm0,0x9(%rsp)
movaps 0xe89(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
call   1040 <blinkstring@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.str = [25 x i8] c"ABCabc\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [25 x i8]
store i32 0, i32* %1
%4 = call i32 @setgpiopin(i32 1)
%5 = call i32 (...) @makecommands()
store i32 456, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @blinknumber(i32 %6, i32 3)
%8 = bitcast [25 x i8]* %3 to i8*
%9 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%10 = call i32 @blinkstring(i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [25 x i8] c"ABCabc\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
define i32 @main() {
%1 = alloca [25 x i8]
%2 = tail call i32 @setgpiopin(i32 1)
%3 = tail call i32 (...) @makecommands()
%4 = tail call i32 @blinknumber(i32 456, i32 3)
%5 = getelementptr inbounds [25 x i8], [25 x i8]* %1, i64 0, i64 0
%6 = call i32 @blinkstring(i8* %5)
ret i32 0
}
int hwlist_lcd_name(const char *value) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @hwlist_lcd_name(i8* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ pstrcpy(char *, int, char const *);
int strlen(char *);
char *pstrcat(char *buf, int buf_size, const char *s) {
  int len;
  len = strlen(buf);
  if (len < buf_size)
    pstrcpy(buf + len, buf_size - len, s);
  return buf;
}


x86 assembly (clang, -O0):
<pstrcat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1165 <pstrcat+0x45>
mov    -0x8(%rbp),%rdi
movslq -0x1c(%rbp),%rax
add    %rax,%rdi
mov    -0xc(%rbp),%esi
sub    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%rdx
call   1030 <pstrcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pstrcat>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmp    %ebp,%eax
jge    1147 <pstrcat+0x27>
movslq %eax,%rdi
add    %rbx,%rdi
sub    %eax,%ebp
mov    %ebp,%esi
mov    %r14,%rdx
call   1030 <pstrcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i8* @pstrcat(i8* returned %0, i32 %1, i8* %2) {
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp slt i32 %4, %1
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = sext i32 %4 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = sub nsw i32 %1, %4
%10 = tail call i32 @pstrcpy(i8* %8, i32 %9, i8* %2)
br label %11
11: ; preds = %6, %3
ret i8* %0
}
int zero(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @zero() {
ret i32 0
}

LLVM IR (-O2):
define i32 @zero() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isalnum(int);
void t_isalnum_0x2f() {
  Assert_real((isalnum(47) == 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",
              240, ("isalnum should be 0 for /"));
}


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

x86 assembly (clang, -O2):
<t_isalnum_0x2f>:
push   %rax
mov    $0x2f,%edi
call   1030 <isalnum@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0xf0,%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_0x2f() {
%1 = call i64 @isalnum(i32 47)
%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 240, 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_0x2f() {
%1 = tail call i64 @isalnum(i32 47)
%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 240, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foo(char *, char *, int, char, char *);
int main() {
  foo("sdcs", "abc", 22, 'z', "def");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
lea    0xed8(%rip),%rsi
mov    $0x16,%edx
mov    $0x7a,%ecx
lea    0xecb(%rip),%r8
call   1030 <foo@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0xee6(%rip),%rsi
lea    0xee3(%rip),%r8
mov    $0x16,%edx
mov    $0x7a,%ecx
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"sdcs\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [4 x i8] c"def\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @foo(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 22, i8 signext 122, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"sdcs\00"
@.str.1 = [4 x i8] c"abc\00"
@.str.2 = [4 x i8] c"def\00"
define i32 @main() {
%1 = tail call i32 @foo(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 22, i8 signext 122, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}
void INT_Excep_ICU_IRQ10(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_ICU_IRQ10() {
ret void
}
/* Variables and functions */
int rand();
int lancer_des() { return rand() % 6 + 1; }


x86 assembly (clang, -O0):
<lancer_des>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lancer_des>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @lancer_des() {
%1 = call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}

LLVM IR (-O2):
define i32 @lancer_des() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 6
%3 = add nsw i32 %2, 1
ret i32 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t flashfsGetWriteBufferSize() { return (128 - 1); }


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

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

LLVM IR (-O0):
define i32 @flashfsGetWriteBufferSize() {
ret i32 127
}

LLVM IR (-O2):
define i32 @flashfsGetWriteBufferSize() {
ret i32 127
}
void func(int a[]) {
  int i;
#pragma acc data copyout(a)
  {
#pragma acc parallel loop
    for (i = 0; i < 10; i++) {
      a[i] = 100;
    }
  }
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1136 <func+0x36>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x64,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <func+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
movups %xmm0,0x10(%rdi)
movabs $0x6400000064,%rax
mov    %rax,0x20(%rdi)
ret

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

LLVM IR (-O2):
define void @func(i32* nocapture writeonly %0) {
%2 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> <i32 100, i32 100, i32 100, i32 100>, <4 x i32>* %2
%3 = getelementptr inbounds i32, i32* %0, i64 4
%4 = bitcast i32* %3 to <4 x i32>*
store <4 x i32> <i32 100, i32 100, i32 100, i32 100>, <4 x i32>* %4
%5 = getelementptr inbounds i32, i32* %0, i64 8
store i32 100, i32* %5
%6 = getelementptr inbounds i32, i32* %0, i64 9
store i32 100, i32* %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ draw_edges();
int /*<<< orphan*/ draw_nodes();
void bm_draw_main(void) {
  ;
  ;
  draw_nodes();
  ;
  ;
  draw_edges();
  ;
}


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

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

LLVM IR (-O0):
define void @bm_draw_main() {
%1 = call i32 (...) @draw_nodes()
%2 = call i32 (...) @draw_edges()
ret void
}

LLVM IR (-O2):
define void @bm_draw_main() {
%1 = tail call i32 (...) @draw_nodes()
%2 = tail call i32 (...) @draw_edges()
ret void
}
int test_arrays(void) {
  int arr[10];
  int *ptr = &arr[5];
  *ptr = 42;
  return arr[5];
}


x86 assembly (clang, -O0):
<test_arrays>:
push   %rbp
mov    %rsp,%rbp
lea    -0x30(%rbp),%rax
add    $0x14,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movl   $0x2a,(%rax)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_arrays() {
%1 = alloca [10 x i32]
%2 = alloca i32*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
store i32* %3, i32** %2
%4 = load i32*, i32** %2
store i32 42, i32* %4
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 5
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @test_arrays() {
ret i32 42
}
__attribute__((no, noclone)) int f4(void) { return 2; }


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

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

LLVM IR (-O0):
define i32 @f4() {
ret i32 2
}

LLVM IR (-O2):
define i32 @f4() {
ret i32 2
}
int ft_min(int a, int b, int c) {
  int m;
  m = a;
  if (m > b)
    m = b;
  if (m > c)
    m = c;
  return (m);
}


x86 assembly (clang, -O0):
<ft_min>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1125 <ft_min+0x25>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1137 <ft_min+0x37>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @ft_min(i32 %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %0, %1
%5 = select i1 %4, i32 %1, i32 %0
%6 = icmp sgt i32 %5, %2
%7 = select i1 %6, i32 %2, i32 %5
ret i32 %7
}
void restore_flow(void) {}


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

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

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

LLVM IR (-O2):
define void @restore_flow() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ MD5_CTX;

/* Variables and functions */
int /*<<< orphan*/ MD5_Final(unsigned char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ MD5_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ MD5_Update(int /*<<< orphan*/ *, unsigned char *,
                              unsigned long);
void DoMD5(unsigned char *mdout, unsigned char *src, unsigned long n) {
  MD5_CTX hash;
  MD5_Init(&hash);
  MD5_Update(&hash, src, n);
  MD5_Final(mdout, &hash);
}


x86 assembly (clang, -O0):
<DoMD5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x1c(%rbp),%rdi
call   1040 <MD5_Init@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rdi
call   1050 <MD5_Update@plt>
mov    -0x8(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <MD5_Final@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DoMD5>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
lea    0x4(%rsp),%r12
mov    %r12,%rdi
call   1040 <MD5_Init@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1050 <MD5_Update@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <MD5_Final@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @DoMD5(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = call i32 @MD5_Init(i32* %7)
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @MD5_Update(i32* %7, i8* %9, i64 %10)
%12 = load i8*, i8** %4
%13 = call i32 @MD5_Final(i8* %12, i32* %7)
ret void
}

LLVM IR (-O2):
define void @DoMD5(i8* %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @MD5_Init(i32* %4)
%7 = call i32 @MD5_Update(i32* %4, i8* %1, i64 %2)
%8 = call i32 @MD5_Final(i8* %0, i32* %4)
ret void
}
int foo() {
  int x[45];
  return 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @foo() {
%1 = alloca [45 x i32]
ret i32 0
}

LLVM IR (-O2):
define i32 @foo() {
ret i32 0
}
/* Variables and functions */
size_t _b64_max(size_t lhs, size_t rhs) { return ((lhs < rhs) ? lhs : rhs); }


x86 assembly (clang, -O0):
<_b64_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1127 <_b64_max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <_b64_max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_b64_max>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovb  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @_b64_max(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 = icmp ult i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @_b64_max(i64 %0, i64 %1) {
%3 = icmp ult i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int getticks();
uint32_t fast_rand() { return ((getticks() & 4294967295) >> 4); }


x86 assembly (clang, -O0):
<fast_rand>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <getticks@plt>
cltq
movabs $0xffffffff,%rcx
and    %rcx,%rax
sar    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fast_rand>:
push   %rax
xor    %eax,%eax
call   1030 <getticks@plt>
shr    $0x4,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fast_rand() {
%1 = call i32 (...) @getticks()
%2 = sext i32 %1 to i64
%3 = and i64 %2, 4294967295
%4 = ashr i64 %3, 4
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @fast_rand() {
%1 = tail call i32 (...) @getticks()
%2 = lshr i32 %1, 4
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ foo(int);
int main(void) {
  for (int i = 0; i < 10; i++)
    foo(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <foo@plt>
mov    $0x1,%edi
call   1030 <foo@plt>
mov    $0x2,%edi
call   1030 <foo@plt>
mov    $0x3,%edi
call   1030 <foo@plt>
mov    $0x4,%edi
call   1030 <foo@plt>
mov    $0x5,%edi
call   1030 <foo@plt>
mov    $0x6,%edi
call   1030 <foo@plt>
mov    $0x7,%edi
call   1030 <foo@plt>
mov    $0x8,%edi
call   1030 <foo@plt>
mov    $0x9,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @foo(i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 0)
%2 = tail call i32 @foo(i32 1)
%3 = tail call i32 @foo(i32 2)
%4 = tail call i32 @foo(i32 3)
%5 = tail call i32 @foo(i32 4)
%6 = tail call i32 @foo(i32 5)
%7 = tail call i32 @foo(i32 6)
%8 = tail call i32 @foo(i32 7)
%9 = tail call i32 @foo(i32 8)
%10 = tail call i32 @foo(i32 9)
ret i32 0
}
int ft_strlen(char *s) {
  int i;
  i = 0;
  while (s && s[i])
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<ft_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0xd(%rbp)
je     1134 <ft_strlen+0x34>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <ft_strlen+0x44>
jmp    1152 <ft_strlen+0x52>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <ft_strlen+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strlen>:
test   %rdi,%rdi
je     111d <ft_strlen+0x1d>
mov    $0xffffffff,%eax
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <ft_strlen+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ft_strlen(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %8, %3 ], [ 0, %1 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
%8 = add nuw i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
%10 = trunc i64 %4 to i32
br label %11
11: ; preds = %9, %1
%12 = phi i32 [ 0, %1 ], [ %10, %9 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isupper(int);
void t_isupper_0x49() {
  Assert_real((isupper(73)),
              "/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_isupper.c",
              370, ("isupper should be 1 for I"));
}


x86 assembly (clang, -O0):
<t_isupper_0x49>:
push   %rbp
mov    %rsp,%rbp
mov    $0x49,%edi
call   1030 <isupper@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x172,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x49>:
push   %rax
mov    $0x49,%edi
call   1030 <isupper@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x172,%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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for I\00"
define void @t_isupper_0x49() {
%1 = call i32 @isupper(i32 73)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 370, 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_isupper.c\00"
@.str.1 = [26 x i8] c"isupper should be 1 for I\00"
define void @t_isupper_0x49() {
%1 = tail call i32 @isupper(i32 73)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 370, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void UTL_SqueezeBlanks(char *s) {
  char *t1, *t2;
  t1 = t2 = s;
  while (*t2 != '\000') {
    if (*t2 != ' ') {
      *t1 = *t2;
      t1++;
    }
    t2++;
  }
  *t1 = '\000';
  return;
}


x86 assembly (clang, -O0):
<UTL_SqueezeBlanks>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <UTL_SqueezeBlanks+0x5d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     114c <UTL_SqueezeBlanks+0x4c>
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <UTL_SqueezeBlanks+0x14>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<UTL_SqueezeBlanks>:
mov    %rdi,%rax
jmp    1114 <UTL_SqueezeBlanks+0x14>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
movzbl (%rax),%ecx
cmp    $0x20,%cl
je     1110 <UTL_SqueezeBlanks+0x10>
test   %cl,%cl
je     1128 <UTL_SqueezeBlanks+0x28>
mov    %cl,(%rdi)
add    $0x1,%rdi
jmp    1110 <UTL_SqueezeBlanks+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @UTL_SqueezeBlanks(i8* nocapture %0) {
br label %2
2: ; preds = %8, %1
%3 = phi i8* [ %0, %1 ], [ %9, %8 ]
%4 = phi i8* [ %0, %1 ], [ %10, %8 ]
%5 = load i8, i8* %4
switch i8 %5, label %6 [
i8 0, label %11
i8 32, label %8
]
6: ; preds = %2
store i8 %5, i8* %3
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %8
8: ; preds = %2, %6
%9 = phi i8* [ %7, %6 ], [ %3, %2 ]
%10 = getelementptr inbounds i8, i8* %4, i64 1
br label %2
11: ; preds = %2
store i8 0, i8* %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_attr_t;

/* Variables and functions */
int pthread_attr_setstack(int /*<<< orphan*/ *, void *, size_t);
int my_pthread_attr_setstack(pthread_attr_t *__attr, void *stack_base,
                             size_t stack_size) {
  pthread_attr_t *realattr = (pthread_attr_t *)*(unsigned int *)__attr;
  return pthread_attr_setstack(realattr, stack_base, stack_size);
}


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

x86 assembly (clang, -O2):
<my_pthread_attr_setstack>:
mov    (%rdi),%edi
jmp    1030 <pthread_attr_setstack@plt>

LLVM IR (-O0):
define i32 @my_pthread_attr_setstack(i32* %0, i8* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i32*
store i32* %0, i32** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = zext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store i32* %11, i32** %7
%12 = load i32*, i32** %7
%13 = load i8*, i8** %5
%14 = load i64, i64* %6
%15 = call i32 @pthread_attr_setstack(i32* %12, i8* %13, i64 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @my_pthread_attr_setstack(i32* nocapture %0, i8* %1, i64 %2) {
%4 = load i32, i32* %0
%5 = zext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = tail call i32 @pthread_attr_setstack(i32* %6, i8* %1, i64 %2)
ret i32 %7
}
int av_reset_stc(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @av_reset_stc() {
ret i32 0
}

LLVM IR (-O2):
define i32 @av_reset_stc() {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int fwrite(void *, int, int, int /*<<< orphan*/ *);
int asf_fileio_write_cb(FILE *stream, void *buffer, int size) {
  int ret;
  ret = fwrite(buffer, 1, size, stream);
  if (!ret && !feof(stream))
    ret = -1;
  return ret;
}


x86 assembly (clang, -O0):
<asf_fileio_write_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
call   1040 <fwrite@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    116e <asf_fileio_write_cb+0x4e>
mov    -0x8(%rbp),%rdi
call   1030 <feof@plt>
cmp    $0x0,%eax
jne    116e <asf_fileio_write_cb+0x4e>
movl   $0xffffffff,-0x18(%rbp)
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<asf_fileio_write_cb>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
mov    $0x1,%esi
mov    %rbx,%rcx
call   1040 <fwrite@plt>
test   %eax,%eax
je     113a <asf_fileio_write_cb+0x1a>
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <feof@plt>
cmp    $0x1,%eax
sbb    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @asf_fileio_write_cb(i32* nocapture %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 @fwrite(i8* %1, i32 1, i32 %2, i32* %0)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @feof(i32* %0)
%8 = icmp eq i32 %7, 0
%9 = sext i1 %8 to i32
br label %10
10: ; preds = %6, %3
%11 = phi i32 [ %4, %3 ], [ %9, %6 ]
ret i32 %11
}
int test_imm_2Eint8_mem(signed char *val) {
  return ((*val) & (-0x2E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_2Eint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = and i32 %5, -46
%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_2Eint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -46
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char const *, char *);
FILE *open_db_file(const char *filename) {
  FILE *fh;
  if ((fh = fopen(filename, "rb")) == NULL) {
  }
  return fh;
}


x86 assembly (clang, -O0):
<open_db_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    113f <open_db_file+0x2f>
jmp    113f <open_db_file+0x2f>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_db_file>:
lea    0xee9(%rip),%rsi
jmp    1030 <fopen@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
define i32* @open_db_file(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = icmp eq i32* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
br label %8
8: ; preds = %7, %1
%9 = load i32*, i32** %3
ret i32* %9
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
define noalias i32* @open_db_file(i8* nocapture %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret i32* %2
}
int main() {
  __attribute__((type_annotate("tainted"))) int x = 2;
  int y = 3;
  __attribute__((type_annotate("tainted"))) int z;
  z = x + y;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: netcfg [<interface> {dhcp|up|down}]\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [44 x i8] c"usage: netcfg [<interface> {dhcp|up|down}]\0A\00"
define void @usage() {
%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"usage: netcfg [<interface> {dhcp|up|down}]\0A\00"
define void @usage() {
%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
}
/* Variables and functions */
float rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
void dados(float *M, int size) {
  int i, j;
  srand(time(NULL));
  for (int i = 0; i < size * size; ++i) {
    M[i] = rand();
  }
}


x86 assembly (clang, -O0):
<dados>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0xc(%rbp),%ecx
cmp    %ecx,%eax
jge    118a <dados+0x5a>
mov    $0x0,%al
call   1050 <rand@plt>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1156 <dados+0x26>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dados>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%r14
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
imul   %ebp,%ebp
test   %ebp,%ebp
je     1176 <dados+0x46>
mov    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <rand@plt>
movss  %xmm0,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1160 <dados+0x30>
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @dados(float* nocapture writeonly %0, i32 %1) {
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = mul i32 %1, %1
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = zext i32 %5 to i64
br label %10
9: ; preds = %10, %2
ret void
10: ; preds = %7, %10
%11 = phi i64 [ 0, %7 ], [ %14, %10 ]
%12 = tail call float (...) @rand()
%13 = getelementptr inbounds float, float* %0, i64 %11
store float %12, float* %13
%14 = add nuw nsw i64 %11, 1
%15 = icmp eq i64 %14, %8
br i1 %15, label %9, label %10
}
int add(int a) {
  if (a > 0)
    return (a + add(a - 1));
  else
    return (0);
}


x86 assembly (clang, -O0):
<add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jle    1145 <add+0x35>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <add@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    114c <add+0x3c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add>:
test   %edi,%edi
jle    1119 <add+0x19>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
imul   %eax,%eax
shr    %rcx
add    %edi,%eax
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @add(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %14
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = mul i32 %4, %4
%6 = zext i32 %4 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %5, %0
%13 = sub i32 %12, %11
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
signed char tf_bb(signed char x, signed char c) { return c / 3; }


x86 assembly (clang, -O0):
<tf_bb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tf_bb>:
imul   $0x56,%esi,%eax
movzwl %ax,%eax
mov    %eax,%ecx
shr    $0xf,%ecx
shr    $0x8,%eax
add    %cl,%al
ret

LLVM IR (-O0):
define signext i8 @tf_bb(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = sdiv i32 %6, 3
%8 = trunc i32 %7 to i8
ret i8 %8
}

LLVM IR (-O2):
define signext i8 @tf_bb(i8 signext %0, i8 signext %1) {
%3 = sdiv i8 %1, 3
ret i8 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ xmalloc(int /*<<< orphan*/);
void *xmemcpy(int /*<<< orphan*/, void const *, int /*<<< orphan*/);
void *xmemdup(const void *src, ssize_t size) {
  return xmemcpy(xmalloc(size), src, size);
}


x86 assembly (clang, -O0):
<xmemdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <xmalloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <xmemcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmemdup>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
mov    %esi,%edi
call   1040 <xmalloc@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %ebx,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <xmemcpy@plt>

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

LLVM IR (-O2):
define i8* @xmemdup(i8* %0, i32 %1) {
%3 = tail call i32 @xmalloc(i32 %1)
%4 = tail call i8* @xmemcpy(i32 %3, i8* %0, i32 %1)
ret i8* %4
}
/* Variables and functions */
double cos(double const);
double sin_gradient(const double x) { return cos(x); }


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

x86 assembly (clang, -O2):
<sin_gradient>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @sin_gradient(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}