xunge/DecIR huggingface dataset:
/* Variables and functions */
scalar_t__ getlogin();
char *iupdrvGetUserName(void) { return (char *)getlogin(); }


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

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

LLVM IR (-O0):
define i8* @iupdrvGetUserName() {
%1 = call i64 (...) @getlogin()
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @iupdrvGetUserName() {
%1 = tail call i64 (...) @getlogin()
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ FlightPlanSettingsHandle();
int /*<<< orphan*/ UAVObjRequestUpdate(int /*<<< orphan*/);
void FlightPlanSettingsRequestUpdate() {
  UAVObjRequestUpdate(FlightPlanSettingsHandle());
}


x86 assembly (clang, -O0):
<FlightPlanSettingsRequestUpdate>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <FlightPlanSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjRequestUpdate@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<FlightPlanSettingsRequestUpdate>:
push   %rax
xor    %eax,%eax
call   1030 <FlightPlanSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjRequestUpdate@plt>

LLVM IR (-O0):
define void @FlightPlanSettingsRequestUpdate() {
%1 = call i32 (...) @FlightPlanSettingsHandle()
%2 = call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}

LLVM IR (-O2):
define void @FlightPlanSettingsRequestUpdate() {
%1 = tail call i32 (...) @FlightPlanSettingsHandle()
%2 = tail call i32 @UAVObjRequestUpdate(i32 %1)
ret void
}
int main(void) {
  const int x = 0;
  const int *p = &x;
  return x;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-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*
store i32 0, i32* %1
store i32 0, i32* %2
store i32* %2, i32** %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ pr(char *, char *, int /*<<< orphan*/);
void pinfo(char *msg) { pr("%s pid: %d\n", msg, getpid()); }


x86 assembly (clang, -O0):
<pinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
lea    0xeb8(%rip),%rdi
call   1040 <pr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pinfo>:
push   %rbx
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <getpid@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <pr@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s pid: %d\0A\00"
define void @pinfo(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (...) @getpid()
%5 = call i32 @pr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s pid: %d\0A\00"
define void @pinfo(i8* %0) {
%2 = tail call i32 (...) @getpid()
%3 = tail call i32 @pr(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
uint64_t doubleToWord64(double input) {
  union {
    double d;
    uint64_t l;
  } u;
  u.d = input;
  return u.l;
}


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

x86 assembly (clang, -O2):
<doubleToWord64>:
movq   %xmm0,%rax
ret

LLVM IR (-O0):
%union.anon = type { double }
define i32 @doubleToWord64(double %0) {
%2 = alloca double
%3 = alloca %union.anon
store double %0, double* %2
%4 = load double, double* %2
%5 = bitcast %union.anon* %3 to double*
store double %4, double* %5
%6 = bitcast %union.anon* %3 to i32*
%7 = load i32, i32* %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @doubleToWord64(double %0) {
%2 = bitcast double %0 to i64
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ s;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
char *string_time(char *fmt) {
  static char s[64];
  time_t now = time(0);
  strftime(s, sizeof(s), fmt, localtime(&now));
  return s;
}


x86 assembly (clang, -O0):
<string_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0x2eec(%rip),%rdi
mov    $0x40,%esi
call   1050 <strftime@plt>
lea    0x2edb(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_time>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
lea    0x2efd(%rip),%r14
mov    %r14,%rdi
mov    $0x40,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
call   1050 <strftime@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@string_time.s = internal global [64 x i8] zeroinitializer
define i8* @string_time(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @time(i32 0)
store i32 %4, i32* %3
%5 = load i8*, i8** %2
%6 = call i32 @localtime(i32* %3)
%7 = call i32 @strftime(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @string_time.s, i64 0, i64 0), i32 64, i8* %5, i32 %6)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @string_time.s, i64 0, i64 0)
}

LLVM IR (-O2):
@string_time.s = internal global [64 x i8] zeroinitializer
define i8* @string_time(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call i32 @time(i32 0)
store i32 %4, i32* %2
%5 = call i32 @localtime(i32* %2)
%6 = call i32 @strftime(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @string_time.s, i64 0, i64 0), i32 64, i8* %0, i32 %5)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @string_time.s, i64 0, i64 0)
}
/* Variables and functions */
int rand();
char randchar(void) {
  int r;
  char c;
  for (;;) {
    r = rand();
    c = (r >> 16) & 0xff;
    if ('a' <= c && c <= 'z')
      break;
  }
  return c;
}


x86 assembly (clang, -O0):
<randchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%ecx
mov    $0x61,%eax
cmp    %ecx,%eax
jg     1153 <randchar+0x43>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1153 <randchar+0x43>
jmp    1158 <randchar+0x48>
jmp    1118 <randchar+0x8>
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<randchar>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <rand@plt>
shr    $0x10,%eax
mov    %eax,%ecx
shl    $0x18,%ecx
add    $0x9fffffff,%ecx
cmp    $0x1afffffe,%ecx
ja     1120 <randchar+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @randchar() {
%1 = alloca i32
%2 = alloca i8
br label %3
3: ; preds = %17, %0
%4 = call i32 (...) @rand()
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = ashr i32 %5, 16
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
store i8 %8, i8* %2
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp sle i32 97, %10
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp sle i32 %14, 122
br i1 %15, label %16, label %17
16: ; preds = %12
br label %18
17: ; preds = %12, %3
br label %3
18: ; preds = %16
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @randchar() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 (...) @rand()
%3 = lshr i32 %2, 16
%4 = shl i32 %3, 24
%5 = add i32 %4, -1610612737
%6 = icmp ult i32 %5, 452984831
br i1 %6, label %7, label %1
7: ; preds = %1
%8 = trunc i32 %3 to i8
ret i8 %8
}
unsigned short setBit_fun_ushort(unsigned short x, unsigned i) {
  return x | 1 << i;
}


x86 assembly (clang, -O0):
<setBit_fun_ushort>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
movzwl -0x2(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setBit_fun_ushort>:
mov    %edi,%eax
bts    %esi,%eax
ret

LLVM IR (-O0):
define zeroext i16 @setBit_fun_ushort(i16 zeroext %0, i32 %1) {
%3 = alloca i16
%4 = alloca i32
store i16 %0, i16* %3
store i32 %1, i32* %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = load i32, i32* %4
%8 = shl i32 1, %7
%9 = or i32 %6, %8
%10 = trunc i32 %9 to i16
ret i16 %10
}

LLVM IR (-O2):
define zeroext i16 @setBit_fun_ushort(i16 zeroext %0, i32 %1) {
%3 = shl nuw i32 1, %1
%4 = trunc i32 %3 to i16
%5 = or i16 %4, %0
ret i16 %5
}
/* Type definitions */
typedef scalar_t__ int32_t;

/* Variables and functions */
int gca_cmp_int32(const void *aa, const void *bb) {
  const int32_t a = *(const int32_t *)aa;
  const int32_t b = *(const int32_t *)bb;
  return (((a) > (b)) - ((b) > (a)));
}


x86 assembly (clang, -O0):
<gca_cmp_int32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x20(%rbp),%rcx
cmp    -0x18(%rbp),%rcx
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gca_cmp_int32>:
mov    (%rdi),%rcx
mov    (%rsi),%rdx
xor    %eax,%eax
xor    %esi,%esi
cmp    %rdx,%rcx
setg   %al
setl   %sil
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @gca_cmp_int32(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i64*
%9 = load i64, i64* %8
store i64 %9, i64* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i64*
%12 = load i64, i64* %11
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = icmp sgt i64 %13, %14
%16 = zext i1 %15 to i32
%17 = load i64, i64* %6
%18 = load i64, i64* %5
%19 = icmp sgt i64 %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @gca_cmp_int32(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp sgt i64 %4, %6
%8 = zext i1 %7 to i32
%9 = icmp sgt i64 %6, %4
%10 = sext i1 %9 to i32
%11 = add nsw i32 %10, %8
ret i32 %11
}
int test_imm_31uint8_mem(unsigned char *val) {
  return ((*val) & (-0x31 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_31uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -49
%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_31uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -49
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0xe3() {
  Assert_real((isbdigit(227) == 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_isbdigit.c",
              1140, ("isbdigit should be 0 for 0xe3"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xe3\00"
define void @t_isbdigit_0xe3() {
%1 = call i64 @isbdigit(i32 227)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1140, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [30 x i8] c"isbdigit should be 0 for 0xe3\00"
define void @t_isbdigit_0xe3() {
%1 = tail call i64 @isbdigit(i32 227)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 1140, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct sd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ w9968cf_write_sb(struct sd *, int);
void w9968cf_smbus_write_nack(struct sd *sd) {
  w9968cf_write_sb(sd, 0x0013);
  w9968cf_write_sb(sd, 0x0012);
}


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

x86 assembly (clang, -O2):
<w9968cf_smbus_write_nack>:
push   %rbx
mov    %rdi,%rbx
mov    $0x13,%esi
call   1030 <w9968cf_write_sb@plt>
mov    %rbx,%rdi
mov    $0x12,%esi
pop    %rbx
jmp    1030 <w9968cf_write_sb@plt>

LLVM IR (-O0):
%struct.sd = type { i32 }
define void @w9968cf_smbus_write_nack(%struct.sd* %0) {
%2 = alloca %struct.sd*
store %struct.sd* %0, %struct.sd** %2
%3 = load %struct.sd*, %struct.sd** %2
%4 = call i32 @w9968cf_write_sb(%struct.sd* %3, i32 19)
%5 = load %struct.sd*, %struct.sd** %2
%6 = call i32 @w9968cf_write_sb(%struct.sd* %5, i32 18)
ret void
}

LLVM IR (-O2):
%struct.sd = type { i32 }
define void @w9968cf_smbus_write_nack(%struct.sd* %0) {
%2 = tail call i32 @w9968cf_write_sb(%struct.sd* %0, i32 19)
%3 = tail call i32 @w9968cf_write_sb(%struct.sd* %0, i32 18)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void free_tab(char **tab) {
  int idx;
  for (idx = 0; tab[idx]; tab++)
    free(tab[idx]);
}


x86 assembly (clang, -O0):
<free_tab>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1158 <free_tab+0x48>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1123 <free_tab+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_tab>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     1131 <free_tab+0x21>
add    $0x8,%rbx
call   1030 <free@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1120 <free_tab+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @free_tab(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %9, %4 ], [ %2, %1 ]
%6 = phi i8** [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @free(i8* %5)
%8 = getelementptr inbounds i8*, i8** %6, i64 1
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
uint16_t get_pid(uint8_t *pid) {
  uint16_t pp = 0;
  pp = (pid[0] & 0x1F) << 8;
  pp |= pid[1];
  return pp;
}


x86 assembly (clang, -O0):
<get_pid>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x1f,%eax
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pid>:
mov    (%rdi),%eax
and    $0x1f,%eax
shl    $0x8,%eax
or     0x4(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @get_pid(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 0
%6 = load i32, i32* %5
%7 = and i32 %6, 31
%8 = shl i32 %7, 8
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = load i32, i32* %3
%13 = or i32 %12, %11
store i32 %13, i32* %3
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
define i32 @get_pid(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = shl i32 %2, 8
%4 = and i32 %3, 7936
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = or i32 %4, %6
ret i32 %7
}
void Pattern8(struct PatternGen_Params *P, struct PatternGen_Settings *S,
              struct PatternGen_Random *R,
              struct PatternGen_PatternFuncSpecific *PS, int I,
              struct PatternGen_Tick *Output) {}


x86 assembly (clang, -O0):
<Pattern8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.PatternGen_Params = type opaque
%struct.PatternGen_Settings = type opaque
%struct.PatternGen_Random = type opaque
%struct.PatternGen_PatternFuncSpecific = type opaque
%struct.PatternGen_Tick = type opaque
define void @Pattern8(%struct.PatternGen_Params* %0, %struct.PatternGen_Settings* %1, %struct.PatternGen_Random* %2, %struct.PatternGen_PatternFuncSpecific* %3, i32 %4, %struct.PatternGen_Tick* %5) {
%7 = alloca %struct.PatternGen_Params*
%8 = alloca %struct.PatternGen_Settings*
%9 = alloca %struct.PatternGen_Random*
%10 = alloca %struct.PatternGen_PatternFuncSpecific*
%11 = alloca i32
%12 = alloca %struct.PatternGen_Tick*
store %struct.PatternGen_Params* %0, %struct.PatternGen_Params** %7
store %struct.PatternGen_Settings* %1, %struct.PatternGen_Settings** %8
store %struct.PatternGen_Random* %2, %struct.PatternGen_Random** %9
store %struct.PatternGen_PatternFuncSpecific* %3, %struct.PatternGen_PatternFuncSpecific** %10
store i32 %4, i32* %11
store %struct.PatternGen_Tick* %5, %struct.PatternGen_Tick** %12
ret void
}

LLVM IR (-O2):
%struct.PatternGen_Params = type opaque
%struct.PatternGen_Settings = type opaque
%struct.PatternGen_Random = type opaque
%struct.PatternGen_PatternFuncSpecific = type opaque
%struct.PatternGen_Tick = type opaque
define void @Pattern8(%struct.PatternGen_Params* nocapture %0, %struct.PatternGen_Settings* nocapture %1, %struct.PatternGen_Random* nocapture %2, %struct.PatternGen_PatternFuncSpecific* nocapture %3, i32 %4, %struct.PatternGen_Tick* nocapture %5) {
ret void
}
/* Variables and functions */
int get_response(char *);
int /*<<< orphan*/ set_cr_noecho_mode();
int /*<<< orphan*/ set_timeout_mode();
int /*<<< orphan*/ tty_mode(int);
int main(void) {
  tty_mode(0);
  set_timeout_mode();
  set_cr_noecho_mode();
  int response = get_response("Do you want another transaction");
  tty_mode(1);
  return response;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %edi,%edi
call   1060 <tty_mode@plt>
mov    $0x0,%al
call   1040 <set_timeout_mode@plt>
mov    $0x0,%al
call   1050 <set_cr_noecho_mode@plt>
lea    0xe95(%rip),%rdi
call   1030 <get_response@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%edi
call   1060 <tty_mode@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %edi,%edi
call   1060 <tty_mode@plt>
xor    %eax,%eax
call   1040 <set_timeout_mode@plt>
xor    %eax,%eax
call   1050 <set_cr_noecho_mode@plt>
lea    0xea3(%rip),%rdi
call   1030 <get_response@plt>
mov    %eax,%ebx
mov    $0x1,%edi
call   1060 <tty_mode@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Do you want another transaction\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @tty_mode(i32 0)
%4 = call i32 (...) @set_timeout_mode()
%5 = call i32 (...) @set_cr_noecho_mode()
%6 = call i32 @get_response(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %2
%7 = call i32 @tty_mode(i32 1)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [32 x i8] c"Do you want another transaction\00"
define i32 @main() {
%1 = tail call i32 @tty_mode(i32 0)
%2 = tail call i32 (...) @set_timeout_mode()
%3 = tail call i32 (...) @set_cr_noecho_mode()
%4 = tail call i32 @get_response(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @tty_mode(i32 1)
ret i32 %4
}
/* Variables and functions */
scalar_t__ is_prime(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int n;
  printf("Enter a number: ");
  scanf("%d", &n);
  if (is_prime(n)) {
    printf("Prime\n");
  } else {
    printf("Not prime\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
cmp    $0x0,%rax
je     117e <main+0x4e>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
jmp    118a <main+0x5a>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
lea    0xebd(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1050 <is_prime@plt>
test   %rax,%rax
lea    0xea3(%rip),%rax
lea    0xea6(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [7 x i8] c"Prime\0A\00"
@.str.3 = [11 x i8] c"Not prime\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i64 @is_prime(i32 %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [10 x i8] c"Not prime\00"
@str.4 = [6 x i8] c"Prime\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i64 @is_prime(i32 %5)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.4, i64 0, i64 0)
%9 = call i32 @puts(i8* dereferenceable(1) %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ system(char *);
int update_system() {
  system("sudo apt-get update");
  system("sudo apt-get upgrade");
  printf("updated system\n");
  return 0;
}


x86 assembly (clang, -O0):
<update_system>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <system@plt>
lea    0xedd(%rip),%rdi
call   1030 <system@plt>
lea    0xee6(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_system>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <system@plt>
lea    0xee0(%rip),%rdi
call   1040 <system@plt>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"sudo apt-get update\00"
@.str.1 = [21 x i8] c"sudo apt-get upgrade\00"
@.str.2 = [16 x i8] c"updated system\0A\00"
define i32 @update_system() {
%1 = call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"sudo apt-get update\00"
@.str.1 = [21 x i8] c"sudo apt-get upgrade\00"
@str = [15 x i8] c"updated system\00"
define i32 @update_system() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @system(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ u_char;
typedef int /*<<< orphan*/ res_state;

/* Variables and functions */
int __libc_res_nquerydomain(int /*<<< orphan*/, char const *, char const *, int,
                            int, int /*<<< orphan*/ *, int,
                            int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                            int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int res_nquerydomain(res_state statp, const char *name, const char *domain,
                     int class, int type, u_char *answer, int anslen) {
  return __libc_res_nquerydomain(statp, name, domain, class, type, answer,
                                 anslen, NULL, NULL, NULL, NULL);
}


x86 assembly (clang, -O0):
<res_nquerydomain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x28(%rbp),%r9
mov    0x10(%rbp),%eax
xor    %r10d,%r10d
mov    %eax,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
movq   $0x0,0x18(%rsp)
movq   $0x0,0x20(%rsp)
call   1030 <__libc_res_nquerydomain@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<res_nquerydomain>:
sub    $0x28,%rsp
mov    0x30(%rsp),%eax
xorps  %xmm0,%xmm0
movups %xmm0,0x18(%rsp)
movups %xmm0,0x8(%rsp)
mov    %eax,(%rsp)
call   1030 <__libc_res_nquerydomain@plt>
add    $0x28,%rsp
ret

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

LLVM IR (-O2):
define i32 @res_nquerydomain(i32 %0, i8* %1, i8* %2, i32 %3, i32 %4, i32* %5, i32 %6) {
%8 = tail call i32 @__libc_res_nquerydomain(i32 %0, i8* %1, i8* %2, i32 %3, i32 %4, i32* %5, i32 %6, i32* null, i32* null, i32* null, i32* null)
ret i32 %8
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int intcelcon_type_of_mixture(int *r, int *mix) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(745, r, mix, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<intcelcon_type_of_mixture>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x2e9,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<intcelcon_type_of_mixture>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x2e9,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

LLVM IR (-O0):
define i32 @intcelcon_type_of_mixture(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca double*
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = load i32*, i32** %4
%9 = load double*, double** %6
%10 = call i32 @_ada_use_c2phc4c(i32 745, i32* %7, i32* %8, double* %9, i32 0)
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @intcelcon_type_of_mixture(i32* %0, i32* %1) {
%3 = tail call i32 @_ada_use_c2phc4c(i32 745, i32* %0, i32* %1, double* undef, i32 0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __streams_init();
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ error_init();
int /*<<< orphan*/ heap_init();
int main(int, char **, char **);
int /*<<< orphan*/ syscall_init();
void __start(int argc, char *argv[], char *envp[]) {
  int ret;
  syscall_init();
  error_init();
  __streams_init();
  heap_init();
  ret = main(argc, argv, envp);
  _exit(ret);
}


x86 assembly (clang, -O0):
<__start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    $0x0,%al
call   1070 <syscall_init@plt>
mov    $0x0,%al
call   1040 <error_init@plt>
mov    $0x0,%al
call   1050 <__streams_init@plt>
mov    $0x0,%al
call   1080 <heap_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1060 <main@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1030 <_exit@plt>

x86 assembly (clang, -O2):
<__start>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
call   1070 <syscall_init@plt>
xor    %eax,%eax
call   1040 <error_init@plt>
xor    %eax,%eax
call   1050 <__streams_init@plt>
xor    %eax,%eax
call   1080 <heap_init@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1060 <main@plt>
mov    %eax,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
define void @__start(i32 %0, i8** %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = call i32 (...) @syscall_init()
%9 = call i32 (...) @error_init()
%10 = call i32 (...) @__streams_init()
%11 = call i32 (...) @heap_init()
%12 = load i32, i32* %4
%13 = load i8**, i8*** %5
%14 = load i8**, i8*** %6
%15 = call i32 @main(i32 %12, i8** %13, i8** %14)
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = call i32 @_exit(i32 %16)
unreachable
}

LLVM IR (-O2):
define void @__start(i32 %0, i8** %1, i8** %2) {
%4 = tail call i32 (...) @syscall_init()
%5 = tail call i32 (...) @error_init()
%6 = tail call i32 (...) @__streams_init()
%7 = tail call i32 (...) @heap_init()
%8 = tail call i32 @main(i32 %0, i8** %1, i8** %2)
%9 = tail call i32 @_exit(i32 %8)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(int /*<<< orphan*/);
void ft_print_zeroes(int i) {
  int c;
  c = -1;
  while (c++ < i)
    ft_putchar('0');
}


x86 assembly (clang, -O0):
<ft_print_zeroes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    -0x4(%rbp),%eax
jge    1145 <ft_print_zeroes+0x35>
mov    $0x30,%edi
call   1030 <ft_putchar@plt>
jmp    1122 <ft_print_zeroes+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_print_zeroes>:
push   %rbx
test   %edi,%edi
js     112f <ft_print_zeroes+0x1f>
mov    %edi,%ebx
add    $0x1,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x30,%edi
call   1030 <ft_putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <ft_print_zeroes+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @ft_print_zeroes(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %5, %3 ], [ -1, %1 ]
%5 = add nsw i32 %4, 1
%6 = tail call i32 @ft_putchar(i32 48)
%7 = icmp eq i32 %5, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dcl_rc();
int /*<<< orphan*/ dcl_ri();
int /*<<< orphan*/ dcl_rll();
int /*<<< orphan*/ dcl_rs();
void test_1(void) {
  dcl_rc();
  dcl_rs();
  dcl_ri();
  dcl_rll();
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <dcl_rc@plt>
mov    $0x0,%al
call   1040 <dcl_rs@plt>
mov    $0x0,%al
call   1060 <dcl_ri@plt>
mov    $0x0,%al
call   1050 <dcl_rll@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
push   %rax
xor    %eax,%eax
call   1030 <dcl_rc@plt>
xor    %eax,%eax
call   1040 <dcl_rs@plt>
xor    %eax,%eax
call   1060 <dcl_ri@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <dcl_rll@plt>

LLVM IR (-O0):
define void @test_1() {
%1 = call i32 (...) @dcl_rc()
%2 = call i32 (...) @dcl_rs()
%3 = call i32 (...) @dcl_ri()
%4 = call i32 (...) @dcl_rll()
ret void
}

LLVM IR (-O2):
define void @test_1() {
%1 = tail call i32 (...) @dcl_rc()
%2 = tail call i32 (...) @dcl_rs()
%3 = tail call i32 (...) @dcl_ri()
%4 = tail call i32 (...) @dcl_rll()
ret void
}
char inb(short port) {
  char ret;
  asm volatile("inb %1, %0" : "=a"(ret) : "Nd"(port));
  return ret;
}


x86 assembly (clang, -O0):
<inb>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    -0x2(%rbp),%dx
in     (%dx),%al
mov    %al,-0x3(%rbp)
movsbl -0x3(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<inb>:
mov    %edi,%edx
in     (%dx),%al
ret

LLVM IR (-O0):
define signext i8 @inb(i16 signext %0) {
%2 = alloca i16
%3 = alloca i8
store i16 %0, i16* %2
%4 = load i16, i16* %2
%5 = call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %4)
store i8 %5, i8* %3
%6 = load i8, i8* %3
ret i8 %6
}

LLVM IR (-O2):
define signext i8 @inb(i16 signext %0) {
%2 = tail call i8 asm sideeffect "inb $1, $0", "={ax},N{dx},~{dirflag},~{fpsr},~{flags}"(i16 %0)
ret i8 %2
}
/* Variables and functions */
int /*<<< orphan*/ HRF_pollreg(int, int, int);
void _wait_txready(void) {
  ;
  HRF_pollreg(0x27, 0x80 | 0x20, 0x80 | 0x20);
}


x86 assembly (clang, -O0):
<_wait_txready>:
push   %rbp
mov    %rsp,%rbp
mov    $0x27,%edi
mov    $0xa0,%edx
mov    %edx,%esi
call   1030 <HRF_pollreg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_wait_txready>:
mov    $0x27,%edi
mov    $0xa0,%esi
mov    $0xa0,%edx
jmp    1030 <HRF_pollreg@plt>

LLVM IR (-O0):
define void @_wait_txready() {
%1 = call i32 @HRF_pollreg(i32 39, i32 160, i32 160)
ret void
}

LLVM IR (-O2):
define void @_wait_txready() {
%1 = tail call i32 @HRF_pollreg(i32 39, i32 160, i32 160)
ret void
}
/* Type definitions */
struct beri_debug {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ beri_debug_destroy(struct beri_debug *);
void beri_debug_client_close(struct beri_debug *bdp) {
  beri_debug_destroy(bdp);
}


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

x86 assembly (clang, -O2):
<beri_debug_client_close>:
jmp    1030 <beri_debug_destroy@plt>

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

LLVM IR (-O2):
%struct.beri_debug = type { i32 }
define void @beri_debug_client_close(%struct.beri_debug* %0) {
%2 = tail call i32 @beri_debug_destroy(%struct.beri_debug* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printMessage(char *);
int main() {
  char a[12], b[12], c[12];
  printMessage("Hello World");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printMessage@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = alloca [12 x i8]
%2 = alloca [12 x i8]
%3 = alloca [12 x i8]
%4 = call i32 @printMessage(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printMessage(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
struct s {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ s_copyn(struct s *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ slen(char const *);
void s_copyz(struct s *sa, const char *s) { s_copyn(sa, s, slen(s)); }


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

x86 assembly (clang, -O2):
<s_copyz>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <slen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <s_copyn@plt>

LLVM IR (-O0):
%struct.s = type { i32 }
define void @s_copyz(%struct.s* %0, i8* %1) {
%3 = alloca %struct.s*
%4 = alloca i8*
store %struct.s* %0, %struct.s** %3
store i8* %1, i8** %4
%5 = load %struct.s*, %struct.s** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @slen(i8* %7)
%9 = call i32 @s_copyn(%struct.s* %5, i8* %6, i32 %8)
ret void
}

LLVM IR (-O2):
%struct.s = type { i32 }
define void @s_copyz(%struct.s* %0, i8* %1) {
%3 = tail call i32 @slen(i8* %1)
%4 = tail call i32 @s_copyn(%struct.s* %0, i8* %1, i32 %3)
ret void
}
/* Variables and functions */
size_t strspn(char *, char *);
int str_chrchk(char *string, char *charset) {
  size_t span;
  span = strspn(string, charset);
  return (span);
}


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

x86 assembly (clang, -O2):
<str_chrchk>:
jmp    1030 <strspn@plt>

LLVM IR (-O0):
define i32 @str_chrchk(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i64 @strspn(i8* %6, i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @str_chrchk(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i64 @strspn(i8* %0, i8* %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
void *calloc(size_t, size_t);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *my_calloc(size_t n, size_t size) {
  void *ptr = calloc(n, size);
  if (ptr == NULL) {
    fprintf(stderr, "calloc failed!\n");
    exit(EXIT_FAILURE);
  }
  return ptr;
}


x86 assembly (clang, -O0):
<my_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    117f <my_calloc+0x4f>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e60(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_calloc>:
push   %rax
call   1030 <calloc@plt>
test   %rax,%rax
je     113d <my_calloc+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"calloc failed!\0A\00"
@EXIT_FAILURE = global i32 0
define i8* @my_calloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = call i8* @calloc(i64 %6, i64 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @EXIT_FAILURE
%15 = call i32 @exit(i32 %14)
unreachable
16: ; preds = %2
%17 = load i8*, i8** %5
ret i8* %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"calloc failed!\0A\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @my_calloc(i64 %0, i64 %1) {
%3 = tail call i8* @calloc(i64 %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %2
ret i8* %3
}
int test_imm_76uint8_mem(unsigned char *val) {
  return ((*val) & (-0x76 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_76uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -118
%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_76uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, -118
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() { printf("ans = %i\n", 1 & 0 + 1); }


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

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

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

LLVM IR (-O2):
@.str = [10 x i8] c"ans = %i\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
struct substrate_vectorization_profile {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ substrate_vectorization_profile_dump_indent(
    int /*<<< orphan*/ *, struct substrate_vectorization_profile *,
    int /*<<< orphan*/);
void substrate_vectorization_profile_dump(
    FILE *output_stream, struct substrate_vectorization_profile *vp) {
  substrate_vectorization_profile_dump_indent(output_stream, vp, 0);
}


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

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

LLVM IR (-O0):
%struct.substrate_vectorization_profile = type { i32 }
define void @substrate_vectorization_profile_dump(i32* %0, %struct.substrate_vectorization_profile* %1) {
%3 = alloca i32*
%4 = alloca %struct.substrate_vectorization_profile*
store i32* %0, i32** %3
store %struct.substrate_vectorization_profile* %1, %struct.substrate_vectorization_profile** %4
%5 = load i32*, i32** %3
%6 = load %struct.substrate_vectorization_profile*, %struct.substrate_vectorization_profile** %4
%7 = call i32 @substrate_vectorization_profile_dump_indent(i32* %5, %struct.substrate_vectorization_profile* %6, i32 0)
ret void
}

LLVM IR (-O2):
%struct.substrate_vectorization_profile = type { i32 }
define void @substrate_vectorization_profile_dump(i32* %0, %struct.substrate_vectorization_profile* %1) {
%3 = tail call i32 @substrate_vectorization_profile_dump_indent(i32* %0, %struct.substrate_vectorization_profile* %1, i32 0)
ret void
}
long **(wcheck_long_ptr_ptr)(long **to_check) { return to_check; }


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

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

LLVM IR (-O0):
define i64** @wcheck_long_ptr_ptr(i64** %0) {
%2 = alloca i64**
store i64** %0, i64*** %2
%3 = load i64**, i64*** %2
ret i64** %3
}

LLVM IR (-O2):
define i64** @wcheck_long_ptr_ptr(i64** readnone returned %0) {
ret i64** %0
}