xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int get_power() {
  FILE *power_file;
  int power_value;
  power_file = fopen("/sys/class/backlight/rpi_backlight/bl_power", "r");
  fscanf(power_file, "%d", &power_value);
  fclose(power_file);
  return power_value;
}


x86 assembly (clang, -O0):
<get_power>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xee4(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed2(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <fscanf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_power>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0xee7(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%rbx
lea    0xeda(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %rax,%rdi
call   1040 <fscanf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
mov    0xc(%rsp),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [44 x i8] c"/sys/class/backlight/rpi_backlight/bl_power\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @get_power() {
%1 = alloca i32*
%2 = alloca i32
%3 = call i32* @fopen(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %1
%4 = load i32*, i32** %1
%5 = call i32 @fscanf(i32* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%6 = load i32*, i32** %1
%7 = call i32 @fclose(i32* %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [44 x i8] c"/sys/class/backlight/rpi_backlight/bl_power\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @get_power() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @fscanf(i32* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = call i32 @fclose(i32* %3)
%6 = load i32, i32* %1
ret i32 %6
}
/* Type definitions */
struct flashrom_flashctx {
  int dummy;
};

/* Variables and functions */
int spi_disable_blockprotect_generic(struct flashrom_flashctx *, int, int,
                                     int /*<<< orphan*/, int);
int spi_disable_blockprotect_bp1_srwd(struct flashrom_flashctx *flash) {
  return spi_disable_blockprotect_generic(flash, 0x0C, 1 << 7, 0, 0xFF);
}


x86 assembly (clang, -O0):
<spi_disable_blockprotect_bp1_srwd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xc,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
mov    $0xff,%r8d
call   1030 <spi_disable_blockprotect_generic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_disable_blockprotect_bp1_srwd>:
mov    $0xc,%esi
mov    $0x80,%edx
xor    %ecx,%ecx
mov    $0xff,%r8d
jmp    1030 <spi_disable_blockprotect_generic@plt>

LLVM IR (-O0):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_disable_blockprotect_bp1_srwd(%struct.flashrom_flashctx* %0) {
%2 = alloca %struct.flashrom_flashctx*
store %struct.flashrom_flashctx* %0, %struct.flashrom_flashctx** %2
%3 = load %struct.flashrom_flashctx*, %struct.flashrom_flashctx** %2
%4 = call i32 @spi_disable_blockprotect_generic(%struct.flashrom_flashctx* %3, i32 12, i32 128, i32 0, i32 255)
ret i32 %4
}

LLVM IR (-O2):
%struct.flashrom_flashctx = type { i32 }
define i32 @spi_disable_blockprotect_bp1_srwd(%struct.flashrom_flashctx* %0) {
%2 = tail call i32 @spi_disable_blockprotect_generic(%struct.flashrom_flashctx* %0, i32 12, i32 128, i32 0, i32 255)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "Usage: xorimage [-i infile] [-o outfile] [-p <pattern>]\n");
  exit(EXIT_FAILURE);
}


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    0x2e98(%rip),%rax
mov    (%rax),%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    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: xorimage [-i infile] [-o outfile] [-p <pattern>]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = call i32 @exit(i32 %3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [57 x i8] c"Usage: xorimage [-i infile] [-o outfile] [-p <pattern>]\0A\00"
@EXIT_FAILURE = global i32 0
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_FAILURE
%4 = tail call i32 @exit(i32 %3)
unreachable
}
double func3(double x) { return x * x; }


x86 assembly (clang, -O0):
<func3>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<func3>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @func3(double %0) {
%2 = fmul double %0, %0
ret double %2
}
char *strcpy(char *dst, const char *src) {
  char *d = dst;
  while (*src != '\0') {
    *dst = *src;
    dst++;
    src++;
  }
  return d;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <strcpy+0x4d>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
test   %cl,%cl
je     1120 <strcpy+0x20>
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
mov    %cl,(%rax,%rdx,1)
movzbl 0x1(%rsi,%rdx,1),%ecx
add    $0x1,%rdx
test   %cl,%cl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %9, %5 ], [ %0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %1, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
ret i8* %0
}
int test_imm_92int64_midword_mem(long long *val) {
  return ((*val >> 16) & (0x92 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_92int64_midword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
sar    $0x10,%rdx
and    $0x92,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_92int64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = ashr i64 %4, 16
%6 = and i64 %5, 146
%7 = icmp ne i64 %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_92int64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 9568256
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
struct page {
  int dummy;
};

/* Variables and functions */
struct page *virt_to_page(void *);
struct page *kmap_to_page(void *addr) {
  return virt_to_page(addr);
}


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

x86 assembly (clang, -O2):
<kmap_to_page>:
jmp    1030 <virt_to_page@plt>

LLVM IR (-O0):
%struct.page = type { i32 }
define %struct.page* @kmap_to_page(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call %struct.page* @virt_to_page(i8* %3)
ret %struct.page* %4
}

LLVM IR (-O2):
%struct.page = type { i32 }
define %struct.page* @kmap_to_page(i8* %0) {
%2 = tail call %struct.page* @virt_to_page(i8* %0)
ret %struct.page* %2
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char const *, int);
char *make_key_val(const char *base, int i, char *key_val) {
  sprintf(key_val, "%s-%d", base, i);
  return key_val;
}


x86 assembly (clang, -O0):
<make_key_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xecb(%rip),%rsi
call   1030 <sprintf@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [6 x i8] c"%s-%d\00"
define i8* @make_key_val(i8* %0, i32 %1, i8* returned writeonly %2) {
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %2, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
ret i8* %2
}
/* Variables and functions */
bool is_leap_year(int year) {
  if (year % 400 == 0) {
    return true;
  } else if (year % 100 == 0) {
    return false;
  } else if (year % 4 == 0) {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_leap_year>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <is_leap_year+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1178 <is_leap_year+0x78>
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1147 <is_leap_year+0x47>
movl   $0x0,-0x4(%rbp)
jmp    1178 <is_leap_year+0x78>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1167 <is_leap_year+0x67>
movl   $0x1,-0x4(%rbp)
jmp    1178 <is_leap_year+0x78>
jmp    116c <is_leap_year+0x6c>
jmp    1171 <is_leap_year+0x71>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_leap_year>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
mov    %eax,%ecx
ror    $0x4,%ecx
cmp    $0xa3d70b,%ecx
jb     112c <is_leap_year+0x2c>
ror    $0x2,%eax
cmp    $0x28f5c29,%eax
jb     1132 <is_leap_year+0x32>
xor    %eax,%eax
test   $0x3,%dil
sete   %al
ret
mov    $0x1,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_leap_year(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %4
%8 = and i32 %0, 3
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %7, %4, %1
%12 = phi i32 [ 1, %1 ], [ 0, %4 ], [ %10, %7 ]
ret i32 %12
}
int test_imm_73int16_reg(short val) {
  return ((val) & (0x73 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_73int16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%edx
and    $0x73,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_73int16_reg(i16 signext %0) {
%2 = and i16 %0, 115
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int M710_f(char *s) {
  debug("M710_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<M710_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<M710_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf06(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"M710_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M710_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [47 x i8] c"M710_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @M710_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void modif_front2modif_front_ext_pcre_delim() {}


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

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

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

LLVM IR (-O2):
define void @modif_front2modif_front_ext_pcre_delim() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *gmtime(int /*<<< orphan*/ *);
void test(void) {
  time_t time;
  struct tm *timestruct;
  timestruct = gmtime(&time);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <gmtime@plt>
mov    %rax,-0x10(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <gmtime@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define void @test() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call %struct.tm* @gmtime(i32* %1)
store %struct.tm* %3, %struct.tm** %2
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define void @test() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call %struct.tm* @gmtime(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printEquals(int width) {
  while (width > 0) {
    printf("=");
    width--;
  }
  printf("\n");
  return;
}


x86 assembly (clang, -O0):
<printEquals>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    113f <printEquals+0x2f>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    111b <printEquals+0xb>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printEquals>:
push   %rbx
test   %edi,%edi
jle    1132 <printEquals+0x22>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x3d,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1120 <printEquals+0x10>
mov    $0xa,%edi
pop    %rbx
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"=\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @printEquals(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %6, %1
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* %2
%9 = add nsw i32 %8, -1
store i32 %9, i32* %2
br label %3
10: ; preds = %3
%11 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
define void @printEquals(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ %0, %1 ]
%5 = tail call i32 @putchar(i32 61)
%6 = add nsw i32 %4, -1
%7 = icmp ugt i32 %4, 1
br i1 %7, label %3, label %8
8: ; preds = %3, %1
%9 = tail call i32 @putchar(i32 10)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ PTRACE_PEEKUSER;
int ptrace(int /*<<< orphan*/, int /*<<< orphan*/, int, int /*<<< orphan*/);
int syscall_get_number(pid_t pid) {
  return ptrace(PTRACE_PEEKUSER, pid, (8 * 10), 0);
}


x86 assembly (clang, -O0):
<syscall_get_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    $0x50,%edx
xor    %ecx,%ecx
call   1030 <ptrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<syscall_get_number>:
mov    %edi,%esi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edi
mov    $0x50,%edx
xor    %ecx,%ecx
jmp    1030 <ptrace@plt>

LLVM IR (-O0):
@PTRACE_PEEKUSER = global i32 0
define i32 @syscall_get_number(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @PTRACE_PEEKUSER
%4 = load i32, i32* %2
%5 = call i32 @ptrace(i32 %3, i32 %4, i32 80, i32 0)
ret i32 %5
}

LLVM IR (-O2):
@PTRACE_PEEKUSER = global i32 0
define i32 @syscall_get_number(i32 %0) {
%2 = load i32, i32* @PTRACE_PEEKUSER
%3 = tail call i32 @ptrace(i32 %2, i32 %0, i32 80, i32 0)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ lines;

/* Variables and functions */
int /*<<< orphan*/ complete_from_string_list(char const *, char const **, int);
void complete_invert(const char str[]) {
  static const char *lines[] = {"f", "s", "o"};
  complete_from_string_list(str, lines, (sizeof(lines) / sizeof((lines)[0])));
}


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

x86 assembly (clang, -O2):
<complete_invert>:
lea    0x2f19(%rip),%rsi
mov    $0x3,%edx
jmp    1030 <complete_from_string_list@plt>

LLVM IR (-O0):
@complete_invert.lines = internal global [3 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0)]
@.str = [2 x i8] c"f\00"
@.str.1 = [2 x i8] c"s\00"
@.str.2 = [2 x i8] c"o\00"
define void @complete_invert(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @complete_from_string_list(i8* %3, i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @complete_invert.lines, i64 0, i64 0), i32 3)
ret void
}

LLVM IR (-O2):
@complete_invert.lines = internal global [3 x i8*] [i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i32 0, i32 0)]
@.str = [2 x i8] c"f\00"
@.str.1 = [2 x i8] c"s\00"
@.str.2 = [2 x i8] c"o\00"
define void @complete_invert(i8* %0) {
%2 = tail call i32 @complete_from_string_list(i8* %0, i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @complete_invert.lines, i64 0, i64 0), i32 3)
ret void
}
void _M2_history_finish(__attribute__((unused)) int argc,
                        __attribute__((unused)) char *argv[]) {}


x86 assembly (clang, -O0):
<_M2_history_finish>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @_M2_history_finish(i32 %0, i8** nocapture %1) {
ret void
}
void put_black_stones(int fV[((5 + 2) * (10 + 2))]) {
  int k;
  for (k = 0; k < ((5 * 10) / 2); k++)
    fV[((5 + 3) + (k) + 2 * ((k) / 5))] = 1;
}


x86 assembly (clang, -O0):
<put_black_stones>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x19,-0xc(%rbp)
jge    1155 <put_black_stones+0x55>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%ecx
add    $0x8,%ecx
mov    -0xc(%rbp),%eax
mov    $0x5,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x18(%rbp),%rax
shl    $0x1,%edx
add    %edx,%ecx
movslq %ecx,%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <put_black_stones+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_black_stones>:
lea    0x20(%rdi),%r8
mov    $0x1,%esi
xor    %ecx,%ecx
mov    $0xcccccccd,%r9d
movabs $0xcccccccccccccccd,%r10
cc cc cc
nopl   0x0(%rax,%rax,1)
mov    %rcx,%rax
mul    %r10
and    $0xfffffffffffffffc,%rdx
movl   $0x1,(%r8,%rdx,2)
cmp    $0x18,%ecx
je     115d <put_black_stones+0x5d>
mov    %esi,%eax
imul   %r9,%rax
shr    $0x21,%rax
and    $0xfffffffe,%eax
add    $0x9,%eax
add    %ecx,%eax
movl   $0x1,(%rdi,%rax,4)
add    $0x2,%rcx
add    $0x2,%esi
add    $0x8,%r8
jmp    1120 <put_black_stones+0x20>
ret

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

LLVM IR (-O2):
define void @put_black_stones(i32* nocapture writeonly %0) {
br label %2
2: ; preds = %14, %1
%3 = phi i32 [ 0, %1 ], [ %23, %14 ]
%4 = add nuw nsw i32 %3, 8
%5 = trunc i32 %3 to i8
%6 = udiv i8 %5, 5
%7 = shl nuw nsw i8 %6, 1
%8 = zext i8 %7 to i32
%9 = add nuw nsw i32 %4, %8
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
store i32 1, i32* %11
%12 = or i32 %3, 1
%13 = icmp eq i32 %12, 25
br i1 %13, label %24, label %14
14: ; preds = %2
%15 = add nuw nsw i32 %3, 9
%16 = trunc i32 %12 to i8
%17 = udiv i8 %16, 5
%18 = shl nuw nsw i8 %17, 1
%19 = zext i8 %18 to i32
%20 = add nuw nsw i32 %15, %19
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %0, i64 %21
store i32 1, i32* %22
%23 = add nuw nsw i32 %3, 2
br label %2
24: ; preds = %2
ret void
}
/* Type definitions */
struct servent {
  int dummy;
};

/* Variables and functions */
struct servent *getservbyname(const char *name, const char *proto) {
  return NULL;
}


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

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

LLVM IR (-O0):
%struct.servent = type { i32 }
define %struct.servent* @getservbyname(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
ret %struct.servent* null
}

LLVM IR (-O2):
%struct.servent = type { i32 }
define noalias %struct.servent* @getservbyname(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret %struct.servent* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int rand_r(unsigned int *);
int /*<<< orphan*/ scanf(char *, int);
unsigned int time(int /*<<< orphan*/ *);
int main() {
  printf("Please input a number from 1 to 20\n");
  int from_input = 0;
  scanf("%d", from_input);
  unsigned int seed = time(NULL);
  int to_guess = rand_r(&seed) % 20 + 1;

  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1060 <scanf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0xc(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <rand_r@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xebb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeac(%rip),%rdi
xor    %esi,%esi
call   1060 <scanf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <rand_r@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Please input a number from 1 to 20\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
%6 = load i32, i32* %2
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%8 = call i32 @time(i32* null)
store i32 %8, i32* %3
%9 = call i32 @rand_r(i32* %3)
%10 = srem i32 %9, 20
%11 = add nsw i32 %10, 1
store i32 %11, i32* %4
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [35 x i8] c"Please input a number from 1 to 20\00"
define i32 @main() {
%1 = alloca i32
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 0)
%4 = bitcast i32* %1 to i8*
%5 = tail call i32 @time(i32* null)
store i32 %5, i32* %1
%6 = call i32 @rand_r(i32* %1)
ret i32 0
}
/* Variables and functions */
unsigned long timer_high();
unsigned long timer_low();
unsigned long clock() {
  unsigned long low = timer_low();
  unsigned long high = timer_high();
  unsigned long t;
  if (timer_low() < low)
    high = timer_high();
  t = high << 32 | low;
  return t;
}


x86 assembly (clang, -O0):
<clock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1030 <timer_low@plt>
mov    %rax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <timer_high@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <timer_low@plt>
cmp    -0x8(%rbp),%rax
jae    115a <clock+0x3a>
mov    $0x0,%al
call   1040 <timer_high@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x20,%rax
or     -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <timer_low@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1040 <timer_high@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <timer_low@plt>
cmp    %r14,%rax
jae    114e <clock+0x2e>
xor    %eax,%eax
call   1040 <timer_high@plt>
mov    %rax,%rbx
shl    $0x20,%rbx
or     %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @clock() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = call i64 (...) @timer_low()
store i64 %4, i64* %1
%5 = call i64 (...) @timer_high()
store i64 %5, i64* %2
%6 = call i64 (...) @timer_low()
%7 = load i64, i64* %1
%8 = icmp ult i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i64 (...) @timer_high()
store i64 %10, i64* %2
br label %11
11: ; preds = %9, %0
%12 = load i64, i64* %2
%13 = shl i64 %12, 32
%14 = load i64, i64* %1
%15 = or i64 %13, %14
store i64 %15, i64* %3
%16 = load i64, i64* %3
ret i64 %16
}

LLVM IR (-O2):
define i64 @clock() {
%1 = tail call i64 (...) @timer_low()
%2 = tail call i64 (...) @timer_high()
%3 = tail call i64 (...) @timer_low()
%4 = icmp ult i64 %3, %1
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i64 (...) @timer_high()
br label %7
7: ; preds = %5, %0
%8 = phi i64 [ %6, %5 ], [ %2, %0 ]
%9 = shl i64 %8, 32
%10 = or i64 %9, %1
ret i64 %10
}
int execute_get_robust_list() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @execute_get_robust_list() {
ret i32 0
}
void RTDirSetTimes(void) {}


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

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

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

LLVM IR (-O2):
define void @RTDirSetTimes() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isascii(int);
int isdigit(int c) {
  if (!isascii(c))
    return 0;
  if (((unsigned char)c >= '0') && ((unsigned char)c <= '9'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <isascii@plt>
cmp    $0x0,%eax
jne    1138 <isdigit+0x28>
movl   $0x0,-0x4(%rbp)
jmp    1169 <isdigit+0x59>
mov    -0x8(%rbp),%eax
movzbl %al,%eax
cmp    $0x30,%eax
jl     1162 <isdigit+0x52>
mov    -0x8(%rbp),%eax
movzbl %al,%eax
cmp    $0x39,%eax
jg     1162 <isdigit+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1169 <isdigit+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isdigit>:
add    $0xffffffd0,%edi
xor    %eax,%eax
cmp    $0xa,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @isascii(i32 %4)
%6 = icmp ne i32 %5, 0
br i1 %6, label %8, label %7
7: ; preds = %1
store i32 0, i32* %2
br label %20
8: ; preds = %1
%9 = load i32, i32* %3
%10 = trunc i32 %9 to i8
%11 = zext i8 %10 to i32
%12 = icmp sge i32 %11, 48
br i1 %12, label %13, label %19
13: ; preds = %8
%14 = load i32, i32* %3
%15 = trunc i32 %14 to i8
%16 = zext i8 %15 to i32
%17 = icmp sle i32 %16, 57
br i1 %17, label %18, label %19
18: ; preds = %13
store i32 1, i32* %2
br label %20
19: ; preds = %13, %8
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18, %7
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
define i32 @isdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint32_t;

/* Variables and functions */
void gpio_den(uint32_t *port, uint8_t pins, uint8_t state) {
  if (state)
    port[0x51C / 4] |= pins;
  else
    port[0x51C / 4] &= ~((uint32_t)pins);
}


x86 assembly (clang, -O0):
<gpio_den>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1136 <gpio_den+0x36>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
or     0xa38(%rax),%rcx
mov    %rcx,0xa38(%rax)
jmp    1150 <gpio_den+0x50>
mov    -0x10(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
mov    -0x8(%rbp),%rax
and    0xa38(%rax),%rcx
mov    %rcx,0xa38(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gpio_den>:
test   %rdx,%rdx
je     110d <gpio_den+0xd>
or     %rsi,0xa38(%rdi)
ret
not    %rsi
and    %rsi,0xa38(%rdi)
ret

LLVM IR (-O0):
define void @gpio_den(i64* %0, i64 %1, i64 %2) {
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64
store i64* %0, i64** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %6
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %3
%10 = load i64, i64* %5
%11 = load i64*, i64** %4
%12 = getelementptr inbounds i64, i64* %11, i64 327
%13 = load i64, i64* %12
%14 = or i64 %13, %10
store i64 %14, i64* %12
br label %22
15: ; preds = %3
%16 = load i64, i64* %5
%17 = xor i64 %16, -1
%18 = load i64*, i64** %4
%19 = getelementptr inbounds i64, i64* %18, i64 327
%20 = load i64, i64* %19
%21 = and i64 %20, %17
store i64 %21, i64* %19
br label %22
22: ; preds = %15, %9
ret void
}

LLVM IR (-O2):
define void @gpio_den(i64* nocapture %0, i64 %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = getelementptr inbounds i64, i64* %0, i64 327
%7 = load i64, i64* %6
%8 = or i64 %7, %1
store i64 %8, i64* %6
br label %14
9: ; preds = %3
%10 = xor i64 %1, -1
%11 = getelementptr inbounds i64, i64* %0, i64 327
%12 = load i64, i64* %11
%13 = and i64 %12, %10
store i64 %13, i64* %11
br label %14
14: ; preds = %9, %5
ret void
}
/* Variables and functions */
float RAND_MAX;
scalar_t__ rand();
void fill_array(float f[], int N) {
  int i;
  for (i = 0; i < N; i++)
    f[i] = (float)rand() / RAND_MAX;
}


x86 assembly (clang, -O0):
<fill_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1164 <fill_array+0x54>
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2ss %rax,%xmm0
mov    0x2ea3(%rip),%rax
divss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <fill_array+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_array>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1153 <fill_array+0x43>
mov    %rdi,%r14
mov    %esi,%r12d
mov    0x2ebf(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
divss  (%r15),%xmm0
movss  %xmm0,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <fill_array+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@RAND_MAX = global float 0.000000e+00
define void @fill_array(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
%5 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %19, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %22
10: ; preds = %6
%11 = call i64 (...) @rand()
%12 = sitofp i64 %11 to float
%13 = load float, float* @RAND_MAX
%14 = fdiv float %12, %13
%15 = load float*, float** %3
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* %15, i64 %17
store float %14, float* %18
br label %19
19: ; preds = %10
%20 = load i32, i32* %5
%21 = add nsw i32 %20, 1
store i32 %21, i32* %5
br label %6
22: ; preds = %6
ret void
}

LLVM IR (-O2):
@RAND_MAX = global float 0.000000e+00
define void @fill_array(float* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %13, %6 ]
%8 = tail call i64 (...) @rand()
%9 = sitofp i64 %8 to float
%10 = load float, float* @RAND_MAX
%11 = fdiv float %9, %10
%12 = getelementptr inbounds float, float* %0, i64 %7
store float %11, float* %12
%13 = add nuw nsw i64 %7, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %15, label %6
15: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ s2show(int);
void s2show_(int *interactive) { s2show(*interactive); }


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

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

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

LLVM IR (-O2):
define void @s2show_(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @s2show(i32 %2)
ret void
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int, int);
void show(int n) { printf("%d: %d\n", n, fib(n)); }


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <fib@plt>
mov    -0x8(%rbp),%esi
mov    %eax,%edx
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %rbx
mov    %edi,%ebx
call   1040 <fib@plt>
lea    0xed1(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
pop    %rbx
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d: %d\0A\00"
define void @show(i32 %0) {
%2 = tail call i32 @fib(i32 %0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %2)
ret void
}
void RTAvlULInsert(void) {}


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

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

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

LLVM IR (-O2):
define void @RTAvlULInsert() {
ret void
}
int DRV_GET_FLASH_INFO(unsigned char *pFlashInfo, unsigned int ulLength) {
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @DRV_GET_FLASH_INFO(i8* nocapture readnone %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ foo(void *);
long ilongplus(long x, long y) {
  x += 24;
  if (!x)
    foo((void *)0);
  return x;
}


x86 assembly (clang, -O0):
<ilongplus>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1140 <ilongplus+0x30>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <foo@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ilongplus>:
push   %rbx
mov    %rdi,%rbx
add    $0x18,%rbx
jne    1121 <ilongplus+0x11>
xor    %edi,%edi
call   1030 <foo@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @ilongplus(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 = add nsw i64 %5, 24
store i64 %6, i64* %3
%7 = load i64, i64* %3
%8 = icmp ne i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %2
%10 = call i32 @foo(i8* null)
br label %11
11: ; preds = %9, %2
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
define i64 @ilongplus(i64 %0, i64 %1) {
%3 = add nsw i64 %0, 24
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @foo(i8* null)
br label %7
7: ; preds = %5, %2
ret i64 %3
}
/* Variables and functions */
double le_read_float(char **);
int /*<<< orphan*/ le_write32(char **, unsigned char);
double read_altitude(void *ptr) {
  unsigned char *i = (unsigned char *)ptr;
  char buf[sizeof(float)];
  le_write32(&buf, i[2] << 24 | i[1] << 16 | i[0] << 8 | i[3]);
  return le_read_float(&buf);
}


x86 assembly (clang, -O0):
<read_altitude>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x14(%rbp),%rdi
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
movzbl %al,%esi
call   1040 <le_write32@plt>
lea    -0x14(%rbp),%rdi
call   1030 <le_read_float@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_altitude>:
push   %rbx
sub    $0x10,%rsp
movzbl 0x3(%rdi),%esi
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <le_write32@plt>
mov    %rbx,%rdi
call   1030 <le_read_float@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @read_altitude(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [4 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8* %5, i8** %3
%6 = bitcast [4 x i8]* %4 to i8**
%7 = load i8*, i8** %3
%8 = getelementptr inbounds i8, i8* %7, i64 2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 24
%12 = load i8*, i8** %3
%13 = getelementptr inbounds i8, i8* %12, i64 1
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = shl i32 %15, 16
%17 = or i32 %11, %16
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 0
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = shl i32 %21, 8
%23 = or i32 %17, %22
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 3
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = or i32 %23, %27
%29 = trunc i32 %28 to i8
%30 = call i32 @le_write32(i8** %6, i8 zeroext %29)
%31 = bitcast [4 x i8]* %4 to i8**
%32 = call double @le_read_float(i8** %31)
ret double %32
}

LLVM IR (-O2):
define double @read_altitude(i8* nocapture %0) {
%2 = alloca [4 x i8]
%3 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%4 = bitcast [4 x i8]* %2 to i8**
%5 = getelementptr inbounds i8, i8* %0, i64 3
%6 = load i8, i8* %5
%7 = call i32 @le_write32(i8** %4, i8 zeroext %6)
%8 = call double @le_read_float(i8** %4)
ret double %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_context_set_source_output_mute() {
  printf("NOT IMPLEMENTED:"
         "pa_context_set_source_output_mute"
         "\n");
}


x86 assembly (clang, -O0):
<pa_context_set_source_output_mute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [51 x i8] c"NOT IMPLEMENTED:pa_context_set_source_output_mute\0A\00"
define i32 @pa_context_set_source_output_mute() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@str = [50 x i8] c"NOT IMPLEMENTED:pa_context_set_source_output_mute\00"
define i32 @pa_context_set_source_output_mute() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
void copy_and_print(char *dest, char *src) {
  strcpy(dest, src);
  printf("%s", src);
}


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

x86 assembly (clang, -O2):
<copy_and_print>:
push   %rbx
mov    %rsi,%rbx
call   1030 <strcpy@plt>
lea    0xed0(%rip),%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @copy_and_print(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* %0, i8* %1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %1)
ret void
}
/* Variables and functions */
int direct_trailing_zeros(unsigned int);
int /*<<< orphan*/ printf(char *, unsigned int, int);
int main() {
  unsigned int n = 26;
  printf("n: %d; z: %d\n", n, direct_trailing_zeros(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1a,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <direct_trailing_zeros@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [14 x i8] c"n: %d; z: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 26, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = call i32 @direct_trailing_zeros(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"n: %d; z: %d\0A\00"
define i32 @main() {
%1 = tail call i32 @direct_trailing_zeros(i32 26)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 26, i32 %1)
ret i32 0
}