xunge/DecIR huggingface dataset:
/* Variables and functions */
int weak();
int main() { return weak(); }


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @weak()
ret i32 %1
}
/* Variables and functions */
int DoMatch(char *, char *);
int wildmat(char *text, char *p) {
  if (p[0] == '*' && p[1] == '\0')
    return 1;
  return DoMatch(text, p) == 1;
}


x86 assembly (clang, -O0):
<wildmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2a,%eax
jne    114d <wildmat+0x3d>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    114d <wildmat+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1168 <wildmat+0x58>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <DoMatch@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wildmat>:
push   %rax
cmpb   $0x2a,(%rsi)
jne    111c <wildmat+0xc>
cmpb   $0x0,0x1(%rsi)
je     112d <wildmat+0x1d>
call   1030 <DoMatch@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x1,%ecx
sete   %al
pop    %rcx
ret
mov    $0x1,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @wildmat(i8* %0, i8* %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 42
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds i8, i8* %1, i64 1
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5, %2
%10 = tail call i32 @DoMatch(i8* %0, i8* %1)
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %5, %9
%14 = phi i32 [ %12, %9 ], [ 1, %5 ]
ret i32 %14
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef scalar_t__ int32_t;

/* Variables and functions */
int32_t saw(uint16_t phase) { return phase - (1 << 15); }


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

x86 assembly (clang, -O2):
<saw>:
lea    -0x8000(%rdi),%rax
ret

LLVM IR (-O0):
define i64 @saw(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = sub nsw i64 %3, 32768
ret i64 %4
}

LLVM IR (-O2):
define i64 @saw(i64 %0) {
%2 = add nsw i64 %0, -32768
ret i64 %2
}
int test_imm_E0int16_reg(short val) {
  return ((val) & (-0xE0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_E0int16_reg>:
test   $0xff20,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_E0int16_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, -224
%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_E0int16_reg(i16 signext %0) {
%2 = and i16 %0, -224
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ recursive(int);
void main() { recursive(10); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0xa,%edi
jmp    1030 <recursive@plt>

LLVM IR (-O0):
define void @main() {
%1 = call i32 @recursive(i32 10)
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @recursive(i32 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ send(int, char const *, scalar_t__, int /*<<< orphan*/);
scalar_t__ strlen(char const *);
void send_response(int client_sock, const char *resp) {
  send(client_sock, resp, strlen(resp) + 1, 0);
}


x86 assembly (clang, -O0):
<send_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
add    $0x1,%rdx
xor    %ecx,%ecx
call   1040 <send@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_response>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    %rsi,%rdi
call   1030 <strlen@plt>
lea    0x1(%rax),%rdx
mov    %ebp,%edi
mov    %rbx,%rsi
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <send@plt>

LLVM IR (-O0):
define void @send_response(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i64 @strlen(i8* %7)
%9 = add nsw i64 %8, 1
%10 = call i32 @send(i32 %5, i8* %6, i64 %9, i32 0)
ret void
}

LLVM IR (-O2):
define void @send_response(i32 %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%4 = add nsw i64 %3, 1
%5 = tail call i32 @send(i32 %0, i8* %1, i64 %4, i32 0)
ret void
}
/* Variables and functions */
unsigned long strtoul(char *, char **, int);
int sysapi_get_uint(char *data, int *err, unsigned long int *val) {
  char *endptr;
  *val = strtoul(data, &endptr, 10);
  if (endptr) {
    *err = -1;
    return -1;
  }
  *err = 0;
  return 0;
}


x86 assembly (clang, -O0):
<sysapi_get_uint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x28(%rbp)
je     1161 <sysapi_get_uint+0x51>
mov    -0x18(%rbp),%rax
movl   $0xffffffff,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1172 <sysapi_get_uint+0x62>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sysapi_get_uint>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rsp,%rsi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
cmp    (%rsp),%rax
sbb    %eax,%eax
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @sysapi_get_uint(i8* %0, i32* nocapture writeonly %1, i64* nocapture writeonly %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = call i64 @strtoul(i8* %0, i8** %4, i32 10)
store i64 %6, i64* %2
%7 = load i8*, i8** %4
%8 = icmp ne i8* %7, null
%9 = sext i1 %8 to i32
store i32 %9, i32* %1
ret i32 %9
}
/* Variables and functions */
int load_plugin(char *);
int builtin_load(size_t argc, char **argv) {
  if (argc < 2) {
    return 1;
  }
  return load_plugin(argv[1]);
}


x86 assembly (clang, -O0):
<builtin_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x2,-0x10(%rbp)
jae    1137 <builtin_load+0x27>
movl   $0x1,-0x4(%rbp)
jmp    1147 <builtin_load+0x37>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <load_plugin@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<builtin_load>:
cmp    $0x2,%rdi
jae    111c <builtin_load+0xc>
mov    $0x1,%eax
ret
mov    0x8(%rsi),%rdi
jmp    1030 <load_plugin@plt>

LLVM IR (-O0):
define i32 @builtin_load(i64 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8**
store i64 %0, i64* %4
store i8** %1, i8*** %5
%6 = load i64, i64* %4
%7 = icmp ult i64 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %2
store i32 1, i32* %3
br label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @load_plugin(i8* %12)
store i32 %13, i32* %3
br label %14
14: ; preds = %9, %8
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @builtin_load(i64 %0, i8** nocapture %1) {
%3 = icmp ult i64 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @load_plugin(i8* %6)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 1, %2 ]
ret i32 %9
}
/* Type definitions */
struct work_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ drv_lcd_enable(int);
void resume_work_1(struct work_struct *work) { drv_lcd_enable(1); }


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

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

LLVM IR (-O0):
%struct.work_struct = type { i32 }
define void @resume_work_1(%struct.work_struct* %0) {
%2 = alloca %struct.work_struct*
store %struct.work_struct* %0, %struct.work_struct** %2
%3 = call i32 @drv_lcd_enable(i32 1)
ret void
}

LLVM IR (-O2):
%struct.work_struct = type { i32 }
define void @resume_work_1(%struct.work_struct* nocapture readnone %0) {
%2 = tail call i32 @drv_lcd_enable(i32 1)
ret void
}
void always_warning() {
  int *p = 0;
  *p = 0xDEADBEEF;
}


x86 assembly (clang, -O0):
<always_warning>:
push   %rbp
mov    %rsp,%rbp
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movl   $0xdeadbeef,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
define void @always_warning() {
%1 = alloca i32*
store i32* null, i32** %1
%2 = load i32*, i32** %1
store i32 -559038737, i32* %2
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int cmp(void const *, void const *);
int CMP(const void *x, const void *y) { return -cmp(x, y); }


x86 assembly (clang, -O0):
<CMP>:
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 <cmp@plt>
mov    %eax,%ecx
xor    %eax,%eax
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CMP>:
push   %rax
call   1030 <cmp@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @CMP(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 @cmp(i8* %5, i8* %6)
%8 = sub nsw i32 0, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @CMP(i8* %0, i8* %1) {
%3 = tail call i32 @cmp(i8* %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void Tcp_Close(int fd) { close(fd); }


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

x86 assembly (clang, -O2):
<Tcp_Close>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @Tcp_Close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
void g_type_children() {}


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

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

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

LLVM IR (-O2):
define void @g_type_children() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ leer_precios(float *);
int /*<<< orphan*/ mostrar_resultado(float **);
int /*<<< orphan*/ poner_a_cero(float **);
int /*<<< orphan*/ procesar_albaran(float *, float **);
int main() {
  float precios[10];
  float gano[12][2];
  leer_precios(precios);
  poner_a_cero(gano);
  procesar_albaran(precios, gano);
  mostrar_resultado(gano);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <leer_precios@plt>
lea    -0x90(%rbp),%rdi
call   1040 <poner_a_cero@plt>
lea    -0x30(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1060 <procesar_albaran@plt>
lea    -0x90(%rbp),%rdi
call   1050 <mostrar_resultado@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x98,%rsp
mov    %rsp,%r14
mov    %r14,%rdi
call   1030 <leer_precios@plt>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <poner_a_cero@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <procesar_albaran@plt>
mov    %rbx,%rdi
call   1050 <mostrar_resultado@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x float]
%3 = alloca [12 x [2 x float]]
store i32 0, i32* %1
%4 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 0
%5 = call i32 @leer_precios(float* %4)
%6 = getelementptr inbounds [12 x [2 x float]], [12 x [2 x float]]* %3, i64 0, i64 0
%7 = bitcast [2 x float]* %6 to float**
%8 = call i32 @poner_a_cero(float** %7)
%9 = getelementptr inbounds [10 x float], [10 x float]* %2, i64 0, i64 0
%10 = getelementptr inbounds [12 x [2 x float]], [12 x [2 x float]]* %3, i64 0, i64 0
%11 = bitcast [2 x float]* %10 to float**
%12 = call i32 @procesar_albaran(float* %9, float** %11)
%13 = getelementptr inbounds [12 x [2 x float]], [12 x [2 x float]]* %3, i64 0, i64 0
%14 = bitcast [2 x float]* %13 to float**
%15 = call i32 @mostrar_resultado(float** %14)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [10 x float]
%2 = alloca [12 x [2 x float]]
%3 = bitcast [10 x float]* %1 to i8*
%4 = bitcast [12 x [2 x float]]* %2 to i8*
%5 = getelementptr inbounds [10 x float], [10 x float]* %1, i64 0, i64 0
%6 = call i32 @leer_precios(float* %5)
%7 = bitcast [12 x [2 x float]]* %2 to float**
%8 = call i32 @poner_a_cero(float** %7)
%9 = call i32 @procesar_albaran(float* %5, float** %7)
%10 = call i32 @mostrar_resultado(float** %7)
ret i32 0
}
/* Variables and functions */
scalar_t__ malloc(int);
int *generate_params(int start, int end, int thread_number) {
  int *params;
  params = (int *)malloc(sizeof(int) * 3);
  *params = start;
  *(params + 1) = end;
  *(params + 2) = thread_number;
  return params;
}


x86 assembly (clang, -O0):
<generate_params>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generate_params>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
mov    $0xc,%edi
call   1030 <malloc@plt>
mov    %ebx,(%rax)
mov    %ebp,0x4(%rax)
mov    %r14d,0x8(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32* @generate_params(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i64 @malloc(i32 12)
%9 = inttoptr i64 %8 to i32*
store i32* %9, i32** %7
%10 = load i32, i32* %4
%11 = load i32*, i32** %7
store i32 %10, i32* %11
%12 = load i32, i32* %5
%13 = load i32*, i32** %7
%14 = getelementptr inbounds i32, i32* %13, i64 1
store i32 %12, i32* %14
%15 = load i32, i32* %6
%16 = load i32*, i32** %7
%17 = getelementptr inbounds i32, i32* %16, i64 2
store i32 %15, i32* %17
%18 = load i32*, i32** %7
ret i32* %18
}

LLVM IR (-O2):
define i32* @generate_params(i32 %0, i32 %1, i32 %2) {
%4 = tail call i64 @malloc(i32 12)
%5 = inttoptr i64 %4 to i32*
store i32 %0, i32* %5
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %1, i32* %6
%7 = getelementptr inbounds i32, i32* %5, i64 2
store i32 %2, i32* %7
ret i32* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void foo2(void) { printf("foo2\n"); }


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

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

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

LLVM IR (-O2):
@str = [5 x i8] c"foo2\00"
define void @foo2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct nlmsghdr {
  int nlmsg_len;
};

/* Variables and functions */
int nlmsg_ok(const struct nlmsghdr *nlh, int remaining) {
  return (remaining >= sizeof(struct nlmsghdr) &&
          nlh->nlmsg_len >= sizeof(struct nlmsghdr) &&
          nlh->nlmsg_len <= remaining);
}


x86 assembly (clang, -O0):
<nlmsg_ok>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movslq -0xc(%rbp),%rcx
xor    %eax,%eax
cmp    $0x4,%rcx
mov    %al,-0xd(%rbp)
jb     1143 <nlmsg_ok+0x43>
mov    -0x8(%rbp),%rax
movslq (%rax),%rcx
xor    %eax,%eax
cmp    $0x4,%rcx
mov    %al,-0xd(%rbp)
jb     1143 <nlmsg_ok+0x43>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
cmp    -0xc(%rbp),%eax
setle  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<nlmsg_ok>:
xor    %eax,%eax
cmp    $0x4,%esi
jb     1115 <nlmsg_ok+0x15>
mov    (%rdi),%ecx
cmp    $0x4,%ecx
jb     1115 <nlmsg_ok+0x15>
xor    %eax,%eax
cmp    %esi,%ecx
setle  %al
ret

LLVM IR (-O0):
%struct.nlmsghdr = type { i32 }
define i32 @nlmsg_ok(%struct.nlmsghdr* %0, i32 %1) {
%3 = alloca %struct.nlmsghdr*
%4 = alloca i32
store %struct.nlmsghdr* %0, %struct.nlmsghdr** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = sext i32 %5 to i64
%7 = icmp uge i64 %6, 4
br i1 %7, label %8, label %20
8: ; preds = %2
%9 = load %struct.nlmsghdr*, %struct.nlmsghdr** %3
%10 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = sext i32 %11 to i64
%13 = icmp uge i64 %12, 4
br i1 %13, label %14, label %20
14: ; preds = %8
%15 = load %struct.nlmsghdr*, %struct.nlmsghdr** %3
%16 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %15, i32 0, i32 0
%17 = load i32, i32* %16
%18 = load i32, i32* %4
%19 = icmp sle i32 %17, %18
br label %20
20: ; preds = %14, %8, %2
%21 = phi i1 [ false, %8 ], [ false, %2 ], [ %19, %14 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
%struct.nlmsghdr = type { i32 }
define i32 @nlmsg_ok(%struct.nlmsghdr* nocapture %0, i32 %1) {
%3 = icmp ugt i32 %1, 3
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds %struct.nlmsghdr, %struct.nlmsghdr* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = icmp ugt i32 %6, 3
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = icmp sle i32 %6, %1
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %8, %4, %2
%12 = phi i32 [ 0, %4 ], [ 0, %2 ], [ %10, %8 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ strcspn(char const *, char *);
scalar_t__ strlen(char const *);
int is_valid_control_type(const char *control_type) {
  return control_type && strlen(control_type) &&
         strcspn(control_type, "./") == strlen(control_type);
}


x86 assembly (clang, -O0):
<is_valid_control_type>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x8(%rbp)
mov    %al,-0x9(%rbp)
je     1184 <is_valid_control_type+0x64>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x9(%rbp)
je     1184 <is_valid_control_type+0x64>
mov    -0x8(%rbp),%rdi
lea    0xe9e(%rip),%rsi
call   1040 <strcspn@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_control_type>:
push   %rbp
push   %r14
push   %rbx
xor    %ebp,%ebp
test   %rdi,%rdi
je     1153 <is_valid_control_type+0x33>
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %rax,%rax
je     1153 <is_valid_control_type+0x33>
mov    %rax,%r14
lea    0xebe(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcspn@plt>
xor    %ebp,%ebp
cmp    %r14,%rax
sete   %bpl
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"./\00"
define i32 @is_valid_control_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp ne i8* %3, null
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = load i8*, i8** %2
%7 = call i64 @strlen(i8* %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %2
%11 = call i64 @strcspn(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = load i8*, i8** %2
%13 = call i64 @strlen(i8* %12)
%14 = icmp eq i64 %11, %13
br label %15
15: ; preds = %9, %5, %1
%16 = phi i1 [ false, %5 ], [ false, %1 ], [ %14, %9 ]
%17 = zext i1 %16 to i32
ret i32 %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"./\00"
define i32 @is_valid_control_type(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = tail call i64 @strlen(i8* %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %3
%7 = tail call i64 @strcspn(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, %4
%9 = zext i1 %8 to i32
br label %10
10: ; preds = %6, %3, %1
%11 = phi i32 [ 0, %3 ], [ 0, %1 ], [ %9, %6 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, char *);
void sort(char **strings, int n) {
  int i;
  for (i = 0; i < n; i++) {
    printf("String %d: %s\n", i, strings[i]);
  }
}


x86 assembly (clang, -O0):
<sort>:
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    115b <sort+0x4b>
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <sort+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sort>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1147 <sort+0x37>
mov    %rdi,%r14
mov    %esi,%r12d
xor    %ebx,%ebx
lea    0xed5(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,8),%rdx
mov    %r15,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1130 <sort+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [15 x i8] c"String %d: %s\0A\00"
define void @sort(i8** nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = trunc i64 %7 to i32
%11 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %10, i8* %9)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int Sub_Menu() {
  int option;
  printf("Digite:\n1) Vetor\n");
  printf("2) Lista\n:");
  scanf("%d", &option);
  return option;
}


x86 assembly (clang, -O0):
<Sub_Menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Sub_Menu>:
push   %rax
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <printf@plt>
lea    0xebb(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Digite:\0A1) Vetor\0A\00"
@.str.1 = [11 x i8] c"2) Lista\0A:\00"
@.str.2 = [3 x i8] c"%d\00"
define i32 @Sub_Menu() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@.str.1 = [11 x i8] c"2) Lista\0A:\00"
@.str.2 = [3 x i8] c"%d\00"
@str = [17 x i8] c"Digite:\0A1) Vetor\00"
define i32 @Sub_Menu() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
ret i32 %6
}
void yy_1_ValueNqChoice(char *yytext, int yyleng) {
  ;
  ;
}


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

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

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

LLVM IR (-O2):
define void @yy_1_ValueNqChoice(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scull_cleanup_module();
int scull_init_module() {
  int result = 0;
  return 0;
fail:
  scull_cleanup_module();
  return result;
}


x86 assembly (clang, -O0):
<scull_init_module>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @scull_init_module() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %2
store i32 0, i32* %1
br label %6
3: ; No predecessors!
%4 = call i32 (...) @scull_cleanup_module()
%5 = load i32, i32* %2
store i32 %5, i32* %1
br label %6
6: ; preds = %3, %0
%7 = load i32, i32* %1
ret i32 %7
}

LLVM IR (-O2):
define i32 @scull_init_module() {
ret i32 0
}
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ si_addr;
};
typedef TYPE_1__ siginfo_t;

/* Variables and functions */
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ mprotect(void *, int, int);
void benchmark2_handler(int sn, siginfo_t *si, void *ctx) {
  unsigned long addr = (((unsigned long)si->si_addr) & ~(4096 - 1));
  mprotect((void *)addr, 4096, PROT_READ | PROT_WRITE);
}


x86 assembly (clang, -O0):
<benchmark2_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
and    $0xfffffffffffff000,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    0x2eb9(%rip),%rax
mov    (%rax),%edx
mov    0x2e90(%rip),%rax
or     (%rax),%edx
mov    $0x1000,%esi
call   1030 <mprotect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<benchmark2_handler>:
mov    $0xfffffffffffff000,%rdi
and    (%rsi),%rdi
mov    0x2ed7(%rip),%rax
mov    0x2eb0(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    $0x1000,%esi
jmp    1030 <mprotect@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64 }
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
define void @benchmark2_handler(i32 %0, %struct.TYPE_3__* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.TYPE_3__*
%6 = alloca i8*
%7 = alloca i64
store i32 %0, i32* %4
store %struct.TYPE_3__* %1, %struct.TYPE_3__** %5
store i8* %2, i8** %6
%8 = load %struct.TYPE_3__*, %struct.TYPE_3__** %5
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = and i64 %10, -4096
store i64 %11, i64* %7
%12 = load i64, i64* %7
%13 = inttoptr i64 %12 to i8*
%14 = load i32, i32* @PROT_READ
%15 = load i32, i32* @PROT_WRITE
%16 = or i32 %14, %15
%17 = call i32 @mprotect(i8* %13, i32 4096, i32 %16)
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64 }
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
define void @benchmark2_handler(i32 %0, %struct.TYPE_3__* nocapture %1, i8* nocapture readnone %2) {
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %1, i64 0, i32 0
%5 = load i64, i64* %4
%6 = and i64 %5, -4096
%7 = inttoptr i64 %6 to i8*
%8 = load i32, i32* @PROT_READ
%9 = load i32, i32* @PROT_WRITE
%10 = or i32 %9, %8
%11 = tail call i32 @mprotect(i8* %7, i32 4096, i32 %10)
ret void
}
int f1(int val) {
  int num = 0;
  int *ptr = &num;
  if (val == 0) {
    int val;
    val = 5;
    ptr = &val;
  }
  return (*ptr + 1);
}


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    112f <f1+0x2f>
movl   $0x5,-0x14(%rbp)
lea    -0x14(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
xor    %eax,%eax
test   %edi,%edi
sete   %al
lea    (%rax,%rax,4),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @f1(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 6, i32 1
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xd6() {
  Assert_real((isodigit(214) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              1075, ("isodigit should be 0 for 0xd6"));
}


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

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

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xd6\00"
define void @t_isodigit_0xd6() {
%1 = call i64 @isodigit(i32 214)
%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 1075, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xd6\00"
define void @t_isodigit_0xd6() {
%1 = tail call i64 @isodigit(i32 214)
%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 1075, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *GetConfigVar(char *);
char *my_GetModemDefaultFile(void) {
  return (GetConfigVar("ModemDefaultFile"));
}


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

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

LLVM IR (-O0):
@.str = [17 x i8] c"ModemDefaultFile\00"
define i8* @my_GetModemDefaultFile() {
%1 = call i8* @GetConfigVar(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
@.str = [17 x i8] c"ModemDefaultFile\00"
define i8* @my_GetModemDefaultFile() {
%1 = tail call i8* @GetConfigVar(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
int test_imm_D5int64_highword_mem(long long *val) {
  return ((*val >> 32) & (0xD5 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_D5int64_highword_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, 32
%6 = and i64 %5, 213
%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_D5int64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 914828034048
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_max_pu8(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_max_pu8(__m64 a, __m64 b) { return _mm_max_pu8(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_max_pu8>:
jmp    1030 <_mm_max_pu8@plt>

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

LLVM IR (-O2):
define i32 @test_mm_max_pu8(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_max_pu8(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  char a[200] = "hello world!\n";
  printf("%s", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xe0(%rbp),%rdi
lea    0xeb9(%rip),%rsi
mov    $0xc8,%edx
call   1040 <memcpy@plt>
lea    -0xe0(%rbp),%rsi
lea    0xf69(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xed1(%rip),%rsi
mov    %rsp,%rbx
mov    $0xc8,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
lea    0xf82(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.a = [200 x i8] c"hello world!\0A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [200 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = bitcast [200 x i8]* %6 to i8*
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %8)
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [200 x i8] c"hello world!\0A\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [200 x i8]
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
ret i32 0
}
int increment_counter(int count, int val) {
  if (val != 10) {
    count++;
  } else if (val == 10) {
    count--;
  }
  return count;
}


x86 assembly (clang, -O0):
<increment_counter>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
je     1122 <increment_counter+0x22>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113a <increment_counter+0x3a>
cmpl   $0xa,-0x8(%rbp)
jne    1135 <increment_counter+0x35>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    113a <increment_counter+0x3a>
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<increment_counter>:
xor    %eax,%eax
cmp    $0xa,%esi
setne  %al
lea    (%rdi,%rax,2),%eax
add    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @increment_counter(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 10
%4 = select i1 %3, i32 -1, i32 1
%5 = add nsw i32 %4, %0
ret i32 %5
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XFocusOutEvent;

/* Variables and functions */
int get_XFocusOutEvent_type(void *_p) {
  return (int)((XFocusOutEvent *)_p)->type;
}


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

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

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

LLVM IR (-O2):
define i32 @get_XFocusOutEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct vector {
  int dummy;
};

/* Variables and functions */
struct vector *new_vector_size(int);
struct vector *new_vector(void) {
  return new_vector_size(50);
}


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

x86 assembly (clang, -O2):
<new_vector>:
mov    $0x32,%edi
jmp    1030 <new_vector_size@plt>

LLVM IR (-O0):
%struct.vector = type { i32 }
define %struct.vector* @new_vector() {
%1 = call %struct.vector* @new_vector_size(i32 50)
ret %struct.vector* %1
}

LLVM IR (-O2):
%struct.vector = type { i32 }
define %struct.vector* @new_vector() {
%1 = tail call %struct.vector* @new_vector_size(i32 50)
ret %struct.vector* %1
}
void mread(unsigned int fd, char *data) {}


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

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

LLVM IR (-O0):
define void @mread(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 @mread(i32 %0, i8* nocapture %1) {
ret void
}
void fdi_relay_initialize(void) {}


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

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

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

LLVM IR (-O2):
define void @fdi_relay_initialize() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ retarget_init();
void SystemInit() { retarget_init(); }


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

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

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

LLVM IR (-O2):
define void @SystemInit() {
%1 = tail call i32 (...) @retarget_init()
ret void
}
int main(int argc, char *argv[]) {
  int led_counter;
  int i;
  led_counter = 0;
  while (1) {
    for (i = 0; i < (*(volatile unsigned int *)(0x80000004)); i++) {
    }
    led_counter++;
    (*(volatile unsigned int *)(0x80000000)) = led_counter;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    $0x80000004,%ecx
mov    (%rcx),%ecx
cmp    %ecx,%eax
jae    1145 <main+0x45>
jmp    1137 <main+0x37>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1120 <main+0x20>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%ecx
mov    $0x80000000,%eax
mov    %ecx,(%rax)
jmp    1119 <main+0x19>

x86 assembly (clang, -O2):
<main>:
xor    %eax,%eax
mov    $0x80000000,%ecx
nopw   0x0(%rax,%rax,1)
mov    $0xffffffff,%edx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%edx
cmp    0x4(%rcx),%edx
jb     1120 <main+0x20>
add    $0x1,%eax
mov    %eax,(%rcx)
jmp    1110 <main+0x10>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
br label %8
8: ; preds = %2, %17
store i32 0, i32* %7
br label %9
9: ; preds = %14, %8
%10 = load i32, i32* %7
%11 = load volatile i32, i32* inttoptr (i64 2147483652 to i32*)
%12 = icmp ult i32 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %9
br label %14
14: ; preds = %13
%15 = load i32, i32* %7
%16 = add nsw i32 %15, 1
store i32 %16, i32* %7
br label %9
17: ; preds = %9
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
%20 = load i32, i32* %6
store volatile i32 %20, i32* inttoptr (i64 2147483648 to i32*)
br label %8
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
br label %3
3: ; preds = %10, %2
%4 = phi i32 [ 0, %2 ], [ %11, %10 ]
br label %5
5: ; preds = %5, %3
%6 = phi i32 [ 0, %3 ], [ %9, %5 ]
%7 = load volatile i32, i32* inttoptr (i64 2147483652 to i32*)
%8 = icmp ult i32 %6, %7
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %5, label %10
10: ; preds = %5
%11 = add nuw nsw i32 %4, 1
store volatile i32 %11, i32* inttoptr (i64 2147483648 to i32*)
br label %3
}
void XtVaGetSubvalues() {}


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

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

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

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